SmtpClient SmtpServer = new SmtpClient("mail.precisetech.com.pk"); var mail = new MailMessage(); mail.From = new MailAddress("hunain@precisetech.com.pk"); string[] to = txtEmailTo.Split(';'); foreach (string mailTo in to) { mail.To.Add(txtEmailTo); } string[] cc = txtCC.Split(';'); foreach (string copyTo in cc) { MailAddress cCopy = new MailAddress(txtCC); mail.CC.Add(cCopy); } 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("hunain@precisetech.com.pk",""); 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)