Ejemplo n.º 1
0
        public AuthMessageSender(
            IOptionsSnapshot <SiteSettings> smtpConfig,
            IWebMailService webMailService)
        {
            _smtpConfig = smtpConfig;
            _smtpConfig.CheckArgumentIsNull(nameof(_smtpConfig));

            _webMailService = webMailService;
            _webMailService.CheckArgumentIsNull(nameof(webMailService));
        }
Ejemplo n.º 2
0
        public AuthMessageSender(
            IConfiguration smtpConfig,
            IWebMailService webMailService)
        {
            _settings = smtpConfig;
            _settings.CheckArgumentIsNull(nameof(_settings));

            _webMailService = webMailService;
            _webMailService.CheckArgumentIsNull(nameof(webMailService));

            smtp = new SmtpConfig
            {
                FromAddress     = _settings["smtp:FromAddress"],
                LocalDomain     = _settings["smtp:LocalDomain"],
                FromName        = _settings["smtp:FromName"],
                Password        = _settings["smtp:Password"],
                PickupFolder    = _settings["smtp:PickupFolder"],
                UsePickupFolder = _settings.GetValue <bool>("smtp:UsePickupFolder"),
                Port            = _settings.GetValue <int>("smtp:Port"),
                Server          = _settings["smtp:Server"],
                Username        = _settings["smtp:Username"],
            };
        }