Ejemplo n.º 1
0
        public ActionResult Contact(ContactVm model)
        {
            Contact entity = new Contact();

            entity.Email   = _encript.EncryptData(model.Email);
            entity.Name    = _encript.EncryptData(model.Subject);
            entity.Message = _encript.EncryptData(model.Message);
            entity.Date    = DateTime.Today.ToString("dd/MM/yyyy");
            _contact.Save(entity);
            return(Redirect("SuccessSendEmail"));
        }
Ejemplo n.º 2
0
 private void SendRestorPasswordEmail()
 {
     _message.Subject = "Restor Password";
     _message.Body    = "Please enter link to restor your password in StudentSystem http://wwww.vavilonci.com/Login/RestorePassword?id=" + _encript.EncryptData(_userID.ToString());
     _message.To.Add(_userEmail);
     _smtpClient.Send(_message);
 }
Ejemplo n.º 3
0
 public IActionResult ForgotPassword(ForgotPassM model)
 {
     if (ModelState.IsValid)
     {
         Login        login = new Login();
         List <Login> list  = _servise.GetAll(x => x.Email == _encript.EncryptData(model.Email));
         if (list.Count != 0)
         {
             EmailServises _email = new EmailServises(list[0]);
             _email.SendEmail(2);
         }
         else
         {
             ModelState.AddModelError(string.Empty, "Тhis email is not in our system.");
             return(View());
         }
     }
     return(RedirectToAction("GoToEmail"));
 }