public class GoogleSmtpTest { public void SendEmailViaGmail() { var message = new MailMessage( "xxx@gmail.com", "yyy@joebloggs.com", "Hi via Google SMTP", "some body"); var client = new SmtpClient("smtp.gmail.com") { EnableSsl = true, Port = 587, Credentials = new NetworkCredential("xxx@gmail.com", "xxx's gmail password") }; client.Send(message); } }
Please, oh Google-gods, rank this blog prominently, and let's save some poor, misguided souls who might be searching for some code on formating a query string in C# or merely grazing for urdu shayaris.... If just one person sees the light, then I've done my job! .... Yes, I am not above shamelessly begging the search engines for relevance .... it's called SEO, right?)
Wednesday, October 20, 2010
How to send an email via GMail using .NET
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment