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