Example #1
0
        public Task Send(SerializableMailMessage message)
        {
            MailMessage mailMessage = new MailMessage();

            mailMessage.From = new MailAddress(message.From.Address, message.From.DisplayName);

            foreach (var to in message.To)
            {
                mailMessage.To.Add(new MailAddress(to.Address, to.DisplayName));
            }

            mailMessage.Subject    = message.Subject;
            mailMessage.Body       = message.Body;
            mailMessage.IsBodyHtml = message.IsBodyHtml;

            return(smtpClient.SendMailAsync(mailMessage));
        }
 public SendMailNotificationJob(SerializableMailMessage message)
 {
     Message = message;
 }