public ActionResult PasswordRecovery(PasswordRecoveryModel model) { if (IsValid(model.Email)) { string result = loginService.ValidateEmail(model.Email); // validate that given email if (!string.IsNullOrEmpty(result)) { string token = Convert.ToBase64String(Guid.NewGuid().ToByteArray()); string mail = encriptDecript.Encrypt(model.Email); var linkurl = "<a href='" + Url.Action("ResetPassword", "Account", new { rt = token, email = mail }, "http") + "'>Click Here</a>"; messageService.SentEmailForPasswordRecovery(model.Email, linkurl); ViewBag.result = "1"; //ModelState.AddModelError("", "Mail sent successfully"); } else { ViewBag.result = "0"; //ModelState.AddModelError("", "Email not registered"); } } return View(model); }
/// <summary> /// view password recovery page /// </summary> /// <returns></returns> public ActionResult PasswordRecovery() { var model = new PasswordRecoveryModel(); return View(model); }