public ActionResult ForgotPassword(UserInfo userInfo) { var result = UserInfoRepo.ForgotPassword(userInfo.CompanyInfo.CEmail); MailMessage mailMessage = new MailMessage("*****@*****.**", userInfo.CompanyInfo.CEmail); mailMessage.Subject = "Password Recovery"; mailMessage.Body = "Your Password is: " + result.Data.Pass; SmtpClient smtpClient = new SmtpClient(); smtpClient.Send(mailMessage); return(View("Login")); }