public void Send(MailerConfig config, Notification notification) { var client = _smtpFactory.Create(config.Host, config.Port); client.Credentials = new NetworkCredential(config.UserName, config.Password); client.EnableSsl = config.EnableSsl; using (var message = new MailMessage(config.From, config.To)) { message.Subject = notification.Title; message.Body = notification.Message; client.Send(message); } }
public void TestConfig(MailerConfig config) { var notif = new Notification("Hadouken", "Test notification from Hadouken."); _mailSender.Send(config, notif); }
public void SetConfig(MailerConfig config) { _keyValueStore.Set("mailer.config", config); }