public IActionResult Contact(ContactViewModal model) { if (ModelState.IsValid) { _mailService.SendMail(Startup.Configuration["AppSettings:SiteEmailAddress"], model.Email, $"sub from {model.Name}", model.Message); ModelState.Clear(); ViewBag.Message = "Mail Sent Thanks"; } return View(); }
public IActionResult Contact() { var m = new ContactViewModal(); return View(m); }