MailMessage message = new MailMessage(); SmtpClient client = new SmtpClient(); try { message.From = new MailAddress(fromemail, fromname); message.Subject = subject; //message.Body = body; //message.IsBodyHtml = true; message.AlternateViews.Add(AlternateView.CreateAlternateViewFromString(body, null, "text/html")); message.To.Add(new MailAddress(to)); if (cc != "") { foreach (string str in cc.Split(new char[] { ',' })) { message.CC.Add(new MailAddress(str.Trim())); } } if (bcc != "") { foreach (string str2 in bcc.Split(new char[] { ',' })) { message.Bcc.Add(new MailAddress(str2.Trim())); } } client.Host = server; client.EnableSsl = true; NetworkCredential credential = new NetworkCredential { UserName = new MailAddress(fromemail, fromname).Address, Password = frompwd }; client.UseDefaultCredentials = true; client.Credentials = credential; client.Port = 0x24b; client.Send(message);
//message.IsBodyHtml = true;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)