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


...{

MailMessage mail = new MailMessage();

mail.To = "
[email protected]";

mail.From = "
[email protected]";

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

mail.Body = "Some text goes here";

mail.FIElds.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1"); //basic authentication

mail.FIElds.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "my_username_here"); //set your username here

mail.FIElds.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "super_secret"); //set your passWord here

SmtpMail.SmtpServer = "mail.mycompany.com"; //your real server goes here

SmtpMail.Send( mail );

}