Esempio n. 1
0
        //Email Sender
        public void  EMailPasswordSender(string receiver, string Password)
        {
            EmailSetting _emailsetting = repositoryEmailSetting.GetEmailSetting;

            MailMessage mail       = new MailMessage();
            SmtpClient  SmtpServer = new SmtpClient(_emailsetting.SMTP_Server);

            mail.From = new MailAddress(_emailsetting.Sender);
            mail.To.Add(receiver);
            mail.Subject = "Your Password";
            string HashUserPassword = repositoryDEncryption.Decrypt(Password);

            mail.Body = HashUserPassword;

            // SmtpServer.Port = _emailsetting.SMTPServer_Port;
            string HashEmailPassword = repositoryDEncryption.Decrypt(_emailsetting.Password);

            SmtpServer.Credentials = new NetworkCredential(_emailsetting.UserName, HashEmailPassword);
            NetworkCredential Credentials = new NetworkCredential(_emailsetting.Sender, HashEmailPassword);

            SmtpServer.Credentials = Credentials;
            // SmtpServer.DeliveryMethod = SmtpDeliveryMethod.Network;
            // SmtpServer.UseDefaultCredentials = true;
            // SmtpServer.EnableSsl = _emailsetting.EnableSSL;

            SmtpServer.Send(mail);
        }
Esempio n. 2
0
        public ActionResult EmailSettingDetails(int?Id)
        {
            if (Id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            EmailSetting model = repositoryEmailSetting.Details(Id);


            // model.UserDetails.FName
            if (model == null)
            {
                return(HttpNotFound());
            }
            model.Password = repositoryDEncrption.Decrypt(model.Password);
            return(View("UpdateEMailSetting", model));
        }
Esempio n. 3
0
        public ActionResult Edit(int?Id)
        {
            if (Id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            var model = repositoryUser.Details(Id);

            model.IENUMRoleDetails = repositoryRole.RoleIEnum;
            model.Password         = repositoryDEncryption.Decrypt(model.Password);


            if (model == null)
            {
                return(HttpNotFound());
            }
            return(View(model));
        }