Beispiel #1
0
 public AccountController(UserManager <PayoutUser> userManager, SignInManager <PayoutUser> signInManager, RoleManager <PayoutRole> roleManager
                          , ILogger <AuthController> logger,
                          IOptions <AppSettingsCls.URLKeys> optionURLKeys,
                          IOptions <AppSettingsCls.OktaKeys> optionOktaKeys,
                          IOptions <AppSettingsCls.MailCredentials> optionMailCredentials)
 {
     _userManager           = userManager;
     _roleManager           = roleManager;
     _logger                = logger;
     _signInManager         = signInManager;
     _optionURLKeys         = optionURLKeys.Value;
     _optionOktaKeys        = optionOktaKeys.Value;
     _optionMailCredentials = optionMailCredentials.Value;
 }
Beispiel #2
0
        public static void SendEmail(AppSettingsCls.MailCredentials _optionMailCredentials, string UserEmail, string Subject, string Body)
        {
            SmtpClient smtpClient = new SmtpClient();

            smtpClient.Host                  = _optionMailCredentials.Host;
            smtpClient.Port                  = _optionMailCredentials.Port;
            smtpClient.DeliveryMethod        = SmtpDeliveryMethod.Network;
            smtpClient.EnableSsl             = false;
            smtpClient.UseDefaultCredentials = false;
            smtpClient.Credentials           = new NetworkCredential(_optionMailCredentials.User, _optionMailCredentials.Password);

            MailMessage mail = new MailMessage();

            mail.From = new MailAddress(_optionMailCredentials.SenderEmail, _optionMailCredentials.SenderName);
            mail.To.Add(new MailAddress(UserEmail));
            mail.Subject    = Subject;
            mail.IsBodyHtml = true;
            mail.Body       = Body;

            smtpClient.Send(mail);
        }
Beispiel #3
0
 public Helpers(IOptions <AppSettingsCls.MailCredentials> optionMailCredentials)
 {
     _optionMailCredentials = optionMailCredentials.Value;
 }