Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. public override MailMessage CreateMailMessage(IEmailNotification emailNotification)
  2. {
  3. var mailMessage = new MailMessage();
  4.  
  5. mailMessage.From = new MailAddress(emailNotification.From);
  6. mailMessage.To.Add(_redirectToEmail);
  7. mailMessage.Subject = emailNotification.Subject;
  8. mailMessage.Body = emailNotification.Body;
  9. mailMessage.IsBodyHtml = emailNotification.IsBodyHtml;
  10.  
  11. if (emailNotification.To.ToLower().Contains("shopfehler"))
  12. mailMessage.Bcc.Add(new MailAddress(_backupBccEmail));
  13.  
  14. if (!string.IsNullOrEmpty(emailNotification.ReplyToList))
  15. mailMessage.ReplyToList.Add(emailNotification.ReplyToList);
  16.  
  17. if (emailNotification.AttachmentsPaths.Count > 0)
  18. {
  19. foreach (var path in emailNotification.AttachmentsPaths)
  20. {
  21. mailMessage.Attachments.Add(new Attachment(path));
  22. }
  23. }
  24.  
  25. return mailMessage;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement