public ActionResult Index(CustomerVM model) { ResponseToken response = new ResponseToken(); string sendGridKey = CoreAppSettings.SendGridApiKey; if (response.score == 0) { var responseString = CaptchaHelper.RecaptchaVerify((string)Session["Token"]).Result;; response = JsonConvert.DeserializeObject <ResponseToken>(responseString); } if (response.score < 0.5) { ModelState.AddModelError("CaptchaFail", "Captcha verification failed. Please enter again "); } if (ModelState.IsValid) { SendMail(model, sendGridKey); return(RedirectToAction("Thanks", "Home")); } return(View(model)); }