public ActionResult SubmitContactUsForm(ContactUs model) { if (ModelState.IsValid) { string encodedResponse = Request.Form["g-Recaptcha-Response"]; var response = ReCaptcha.Validate(encodedResponse, SensativeInformation.ReCaptchaKeys.ReCaptchaSecretKey); bool isCaptchaValid = response.ToLower() == "true" ? true : false; if (!isCaptchaValid) { ModelState.AddModelError("", "Please verify you are not a robot"); return(CurrentUmbracoPage()); } ContactUsEmailModel emailModel = new ContactUsEmailModel(); emailModel.Info = model; emailModel.BaseUri = UrlHelpers.GetBaseUrl(); ViewData.Model = emailModel; var html = RazorHelpers.RenderRazorViewToString("~/Views/Emails/ContactUsEmail.cshtml", ControllerContext, ViewData, TempData); var emailService = new EmailService.EmailHelpers(); emailService.SendEmail("*****@*****.**", "Query from contact form", html); TempData["Success"] = "That is winging its way to us now. We will be in contact as soon as we can."; return(RedirectToCurrentUmbracoPage()); } return(CurrentUmbracoPage()); }