Пример #1
0
        private void InitializeClient(MailServerConfig config)
        {
            client           = new SmtpClient();
            client.Host      = config.SmtpServer;
            client.Port      = config.SmtpPort;
            client.EnableSsl = true;
            var credentials = new NetworkCredential();

            credentials.UserName = config.SenderEmail;
            credentials.Password = config.SenderPassword;
            client.Credentials   = credentials;
        }
Пример #2
0
 public MailService(MailServerConfig config, ILogger logger)
 {
     this.logger = logger;
     InitializeClient(config);
     sender = config.SenderEmail;
 }