SmtpServer.Credentials = new System.Net.NetworkCredential(txtEmailFrom, ""); SmtpClient SmtpServer = new SmtpClient("[DELETED].pk"); var mail = new MailMessage(); mail.From = new MailAddress(txtEmailFrom); string[] to = txtEmailTo.Split(';'); foreach (string mailTo in to) { mail.To.Add(mailTo); } string[] cc = txtCC.Split(';'); foreach (string copyTo in cc) { MailAddress cCopy = new MailAddress(txtCC); mail.CC.Add(copyTo); } mail.Subject = txtSubject; mail.IsBodyHtml = true; // mail.CC = txtCC; string htmlBody; htmlBody = txtBody; mail.Body = txtBody; SmtpServer.Port = 25; SmtpServer.UseDefaultCredentials = false; SmtpServer.Credentials = new System.Net.NetworkCredential(txtEmailFrom, ""); SmtpServer.EnableSsl = false; try { SmtpServer.Send(mail); ViewBag.Confirmation = "Daily Log Has Been Submitted"; return View(); } catch (Exception ex) { ViewBag.Confirmation = ex.Message; return View(); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)