예제 #1
0
        /// <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;
        }
예제 #2
0
 /// <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);
 }
예제 #3
0
 public void QueueEmail(Email email)
 {
     this._emails.Enqueue(email);
 }