C4Swimmers Newsletter  

(Article) C# HTML email through Gmail

Article : C# HTML email through Gmail

SMTP Email
C#.NET comes with built-in libraries to send html email easily. Particulary in this article, we'll focus on sending email with Google's Gmail service. You will need a gmail account, which is free to make if you don't already have one.The trick to send html email messages is to connect to Gmail's SMTP server. STMP stands for Simple Mail Transfer Protocol and is a popular way to send emails.

NET Namespace
There are two .NET namespaces that can be used to send html email: System.Web.Mail and System.Net.Mail. All you need to know is System.Web.Mail is older, so it is better to use System.Net.Mail (that is assuming you are using .NET Framework 2.0 and up).

The classes in the namespace work for sending emails in both WinForms and ASP.NET.

SMTPClient
The SMTPClient class is easy to use, there are just some properties to consider. For sending html email through Gmail, for example, the host is smtp.gmail.com and the port number is 587. The class can work for other SMTP providers, just specify the host name and the proper port number.

| Read More..

Courtesy:- vcskicks.com