예제 #1
0
 public ActionResult PasswordRecovery(PasswordRecoveryModel model)
 {
     if (IsValid(model.Email))
     {
         string result = loginService.ValidateEmail(model.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);
             ModelState.AddModelError("", "Mail sent successfully");
         }
         else
         {
             ModelState.AddModelError("", "Email not registered");
         }
     }
     return View(model);
 }
예제 #2
0
 public ActionResult PasswordRecovery()
 {
     var model = new PasswordRecoveryModel();
     return View(model);
 }