예제 #1
0
        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));
        }
예제 #2
0
        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));
        }
예제 #3
0
        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));
        }