How to send authenticated emails

If you are using the .NET Framework 1.0, this cannot be done. However, in the
1.1 version, the MailMessage.Fields property was added. This allowed access to
the underlying CDO.Message fields.

The following example demonstrates sending your username and password to the
SMTP server to provide authentication.

[ C# ]

private void Page_Load(object sender, System.EventArgs e)


MailMessage mail = new MailMessage();

mail.To = "";

mail.From = "";

mail.Subject = "this is a test email.";

mail.Body = "Some text goes here";

"1"); //basic authentication

"my_username_here"); //set your username here

"super_secret"); //set your password here

SmtpMail.SmtpServer = ""; //your real server goes

SmtpMail.Send( mail );



Popular posts from this blog

മലയാളത്തില്‍ മൊത്തം എത്ര അക്ഷരങ്ങള്‍ ഉണ്ട്?

Convert Number To Words in SQL Sever

Crystal reports load report failed: Could not load file or assembly CrystalDecisions.Web, Version=10.2.3600.0