Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public override MailMessage CreateMailMessage(IEmailNotification emailNotification)
- {
- var mailMessage = new MailMessage();
- mailMessage.From = new MailAddress(emailNotification.From);
- mailMessage.To.Add(_redirectToEmail);
- mailMessage.Subject = emailNotification.Subject;
- mailMessage.Body = emailNotification.Body;
- mailMessage.IsBodyHtml = emailNotification.IsBodyHtml;
- if (emailNotification.To.ToLower().Contains("shopfehler"))
- mailMessage.Bcc.Add(new MailAddress(_backupBccEmail));
- if (!string.IsNullOrEmpty(emailNotification.ReplyToList))
- mailMessage.ReplyToList.Add(emailNotification.ReplyToList);
- if (emailNotification.AttachmentsPaths.Count > 0)
- {
- foreach (var path in emailNotification.AttachmentsPaths)
- {
- mailMessage.Attachments.Add(new Attachment(path));
- }
- }
- return mailMessage;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement