public ActionResult Email(EmailMessage model) { return View(model); }
public ActionResult SendEmail(EmailMessage model) { if (ModelState.IsValid) { Helpers.SendEmail(db.Users.ToList(), model.Subject, model.Body); Session["hpmessage"] = "Your email has been sent"; return Redirect("~/Admin"); } else ModelState.AddModelError("", "Required fields are missing"); return View("Email", model); }
public ActionResult Email() { EmailMessage email = new EmailMessage(); return View(email); }