public async Task<ActionResult> Contact(EmailFormModel model)
 {
     if (ModelState.IsValid)
     {
         var body = "<p>Email From: {0} ({1})</p><p>Message:</p><p>{2}</p>";
         var message = new MailMessage();
         message.To.Add(new MailAddress("*****@*****.**"));  // replace with valid value 
         message.From = new MailAddress(model.FromEmail);  // replace with valid value
         message.Subject = model.Subject;
         message.Body = string.Format(body, model.FromName, model.FromEmail, model.Message);
         message.IsBodyHtml = true;
         using (var smtp = new SmtpClient())
         {
             await smtp.SendMailAsync(message);
             return RedirectToAction("Sent");
         }
     }
     return View(model);
 }
 public JsonResult GetData()
 {
     EmailFormModel efm = new EmailFormModel();
     efm.FromName = "Mel";
     efm.FromEmail = "*****@*****.**";
     efm.Subject = "From Server";
     return Json(efm, JsonRequestBehavior.AllowGet);
 }