Ejemplo n.º 1
0
 public bool SendEmail(EmailAddresses addresses, string subject, string body)
 {
     return(SendEmail(new EmailMessage(addresses)
     {
         Subject = subject, Body = body
     }));
 }
Ejemplo n.º 2
0
 private void AddReplyToIfDefined(EmailAddresses emailAddresses, MailMessage mailMessage)
 {
     if (!string.IsNullOrEmpty(emailAddresses.ReplyTo))
     {
         mailMessage.ReplyTo = new MailAddress(emailAddresses.ReplyTo);
     }
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Create a message with reasonable defaults
 /// </summary>
 /// <remarks>
 /// By default the message will be plain text
 /// </remarks>
 public EmailMessage(EmailAddresses emailAddresses)
 {
     _emailAddresses = emailAddresses;
     Subject         = string.Empty;
     Body            = string.Empty;
     AttachmentPath  = string.Empty;
     IsHtmlBody      = false;
 }
Ejemplo n.º 4
0
 private void AddCcs(EmailAddresses emailAddresses, MailMessage mailMessage)
 {
     foreach (string cc in emailAddresses.CcList)
     {
         if (cc.Trim().Length > 0)
         {
             mailMessage.CC.Add(cc);
         }
     }
 }
Ejemplo n.º 5
0
 private void AddBccs(EmailAddresses emailAddresses, MailMessage mailMessage)
 {
     foreach (string bcc in emailAddresses.BccList)
     {
         if (bcc.Trim().Length > 0)
         {
             mailMessage.Bcc.Add(bcc);
         }
     }
 }
Ejemplo n.º 6
0
        private void AddTos(EmailAddresses emailAddresses, MailMessage mailMessage)
        {
            if (emailAddresses.RecipientList.Count < 2)
            {
                return;
            }

            for (int i = 1; i < emailAddresses.RecipientList.Count; i++)
            {
                mailMessage.To.Add(emailAddresses.RecipientList.ElementAt(i));
            }
        }
Ejemplo n.º 7
0
 public EmailMessage(string from, string to, string cc)
     : this(new EmailAddresses(from, to) { CcList = EmailAddresses.SplitEmailAddresses(cc) })
 {
 }