private void SendYourEmailFunction()
{
MailMessage myMsg= new MailMessage();
myMsg.To.Add("
This e-mail address is being protected from spambots. You need JavaScript enabled to view it
");
myMsg.Bcc.Add("
This e-mail address is being protected from spambots. You need JavaScript enabled to view it
");
myMsg.Subject = "test mail";
myMsg.From = new MailAddress("
This e-mail address is being protected from spambots. You need JavaScript enabled to view it
");
myMsg.Body = HttpUtility.HtmlDecode(messageContent); html format
myMsg.IsBodyHtml = true;
SmtpClient smtp = new SmtpClient();
System.Net.NetworkCredential AuthInfo = new System.Net.NetworkCredential("
This e-mail address is being protected from spambots. You need JavaScript enabled to view it
", "mypassword");
smtp.Host = strSMTPServer; // smtp.yourdomain.com
smtp.UseDefaultCredentials = false;
smtp.Credentials = AuthInfo;
smtp.Timeout = 20;
smtp.Port = 25;
smtp.EnableSsl = false;
smtp.DeliveryMethod = SmtpDeliveryMethod.Network;
smtp.Send(myMsg);
}
Read more: http://feeds.dzone.com/~r/dzone/snippets/~3/HaTvjV31f_I/14473