public void Initialize(IEmailBuilder emailBuilder, EmailBase email) { emailBuilder.SetSender(email.From); emailBuilder.SetContent(email.Subject, email.Content, email.ContentType); if (email.Headers.Count > 0) emailBuilder.AddToWithHeader(email.Headers); foreach (EmailAddress emailAddress in email.To) { emailBuilder.AddToRecipient(emailAddress); } foreach (EmailAddress emailAddress in email.Cc) { emailBuilder.AddCcRecipient(emailAddress); } foreach (EmailAddress emailAddress in email.Bcc) { emailBuilder.AddBccRecipient(emailAddress); } }
public void Initialize(IEmailBuilder emailBuilder, EmailBase email) { emailBuilder.SetSender(email.From); emailBuilder.SetContent(email.Subject, email.Content, email.ContentType); if (email.Headers.Count > 0) { emailBuilder.AddToWithHeader(email.Headers); } foreach (EmailAddress emailAddress in email.To) { emailBuilder.AddToRecipient(emailAddress); } foreach (EmailAddress emailAddress in email.Cc) { emailBuilder.AddCcRecipient(emailAddress); } foreach (EmailAddress emailAddress in email.Bcc) { emailBuilder.AddBccRecipient(emailAddress); } }