예제 #1
0
 public EmailResult SendContactMessage(HomeContactModel model)
 {
     To.Add("*****@*****.**");
     From = model.EmailAddress;
     ReplyTo.Add(model.EmailAddress);
     Subject = "{0} sent a message".FormatWith(model.Name);
     return Email("Contact", model);
 }
예제 #2
0
        public ActionResult Contact(HomeContactModel model)
        {
            if (ModelState.IsValid
                && Try(() => _mailer.SendContactMessage(model).DeliverAsync()))
            {
                return RedirectToAction("ContactSuccess");
            }

            return RedirectToAction("Contact");
        }