/// <summary> /// Creates the mail message. /// </summary> /// <param name="email">The email.</param> private MailMessage CreateMailMessage(Email email) { MailMessage message = new MailMessage(); message.Sender = new MailAddress(this._emailAddress); this.AddMailsToCollection(message.To, email.Receipients); this.AddMailsToCollection(message.CC, email.Copy); this.AddMailsToCollection(message.Bcc, email.BlindCopy); message.Subject = email.Subject; message.Body = email.Body; message.IsBodyHtml = true; return message; }
/// <summary> /// Sends the email. /// </summary> /// <param name="email">The email.</param> public void SendEmail(Email email) { MailMessage message = this.CreateMailMessage(email); this._smtpClient.SendMailAsync(message); }
public void QueueEmail(Email email) { this._emails.Enqueue(email); }