Beispiel #1
0
        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);
            }
        }
Beispiel #2
0
 public void TestConfig(MailerConfig config)
 {
     var notif = new Notification("Hadouken", "Test notification from Hadouken.");
     _mailSender.Send(config, notif);
 }
Beispiel #3
0
 public void SetConfig(MailerConfig config)
 {
     _keyValueStore.Set("mailer.config", config);
 }