Displaying posts categorized under

Sending mail

Send mail from ASP.NET using your gmail account

In this article we created a generic ASP.NET SendMail function – which I thought should fit most scenarios. I.e authentication/no authentication, localhost/remote host etc.
However, one thing the function can’t do is SSL authentication. Lets add that:

public static void SendMail(string sHost, int nPort, string sUserName, string sPassword, string sFromName, string sFromEmail,
[...]

Send mail with username and password against other email server

This little snippet is what I use when I send emails from my ASP.NET applications. While the default SMTP server is closed on my box I need to authenticate against the mail server and the code for that is nothing you remember from time to time – so here it is:

public static void SendMail(string sHost, int [...]