コード例 #1
0
 private SmtpClient InitializeClient(MailServerConfig config) => new SmtpClient
 {
     Host        = config.SmtpServer,
     Port        = config.SmtpPort,
     EnableSsl   = true,
     Credentials = new NetworkCredential
     {
         UserName = config.SenderEmail,
         Password = config.SenderPassword
     }
 };
コード例 #2
0
 public MailService(MailServerConfig config, ILogger logger)
 {
     _logger = logger;
     _client = InitializeClient(config);
 }