public ActionResult Contact(ContactModel model) { var msg = string.Format("Comment From: {1}{0} Phone: {2}{0} Email: {3}{0} Comment: {4}{0}", Environment.NewLine, model.fullname, model.phone, model.email, model.comment); var svc = new MailService(); if(svc.SendMail("*****@*****.**", "*****@*****.**", "WebSite contact", msg)) { ViewBag.MailSent = true; } return View(); }
public ActionResult Contact(ContactModel contactModel) { var svc = new MailService(); var msg = string.Format("Comment From: {1}{0}Email:{2}{0}Website: {3}{0}Comment{4}{0}" , Environment.NewLine , contactModel.Name , contactModel.Email , contactModel.Website , contactModel.Comment); svc.SendMail("*****@*****.**", "*****@*****.**", "Website Contact", msg); ViewBag.MailSent = true; if (_mail.SendMail("*****@*****.**", "*****@*****.**", "Website Contract", msg)) { ViewBag.MailSent = true; } return View(); }