public JsonResult Subscribe(string none, string email) { var success = false; var msg = string.Empty; if (MailUtility.SendSingleMail(email)) { success = true; msg = "Your request has been submitted successfully."; } return(Json(new { success = success, message = msg }, JsonRequestBehavior.AllowGet)); }
public JsonResult SubscribeNewsletter(string email) { var success = false; var msg = string.Empty; var body = "<html><body>Congratulations! " + email + " has subscribed </body></html>"; var cc = new List <string>(); cc.Add("*****@*****.**"); cc.Add("*****@*****.**"); if (MailUtility.SendSingleMail("*****@*****.**", cc, "*****@*****.**", "Newsletter submission", body, true)) { success = true; msg = "Your request has been submitted successfully."; } return(Json(new { success = success, message = msg }, JsonRequestBehavior.AllowGet)); }
public JsonResult ContactUs(string fullName, string email, string message) { var success = false; var msg = string.Empty; var body = "<html><body>Name : " + fullName + "<br/>" + "Email : " + email + "<br />" + "Message : " + message + "<br /></body></html>"; var cc = new List <string>(); cc.Add("*****@*****.**"); cc.Add("*****@*****.**"); if (MailUtility.SendSingleMail("*****@*****.**", cc, "*****@*****.**", "Contact us enquiry", body, true)) { success = true; msg = "Your request has been submitted successfully."; } return(Json(new { success = success, message = msg }, JsonRequestBehavior.AllowGet)); }