Пример #1
0
        public ActionResult Contact(ContactSubmit cSubmit)
        {
            if (ModelState.IsValid)
            {
                cSubmit.SubmitDate = DateTime.Now;
                db.ContactSubmits.Add(cSubmit);
                db.SaveChanges();

                if (!System.Web.HttpContext.Current.IsDebuggingEnabled)
                {
                    SendEmailService es = new SendEmailService();
                    es.SendOneEmail(cSubmit.Email, "*****@*****.**", "Kingsley.io - Contact Form Submission", cSubmit.Name + " (" + cSubmit.Email + ") has submited the contact form on Kingsley.io. <br /><br /><strong>Message:</strong><br />" + cSubmit.Message, true);
                }
            }

            return(PartialView("_ContactThanks"));
        }