Beispiel #1
0
 public void BuildMessage_Bcc()
 {
     EmailMessage message = Emailer.BuildMessage(_emailerFilePath, SectionKeyEmailHealthTest, this);
     if (_emailerConfig[SectionKeyEmailHealthTest].Bcc != null && message.Bcc.Address != null)
     {
         string source = _emailerConfig[SectionKeyEmailHealthTest].Bcc;
         EmailAddress emailAddress = new EmailAddress(source);
         Assert.AreEqual(emailAddress.Address, message.Bcc.Address);
     }
     else
         Assert.IsTrue((_emailerConfig[SectionKeyEmailHealthTest].Bcc == null || _emailerConfig[SectionKeyEmailHealthTest].Bcc.Trim() == string.Empty) &&
             (message.Bcc.Address == null || message.Bcc.Address.Trim() == string.Empty));
 }
Beispiel #2
0
 /// <overloads>
 /// + 7 Overloads.
 /// </overloads>
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="messageText">Message body</param>
 /// <param name="server">SMTP server</param>
 /// <param name="to">To</param>
 /// <param name="from">From</param>
 /// <param name="subject">Subject</param>
 /// <param name="cc">CC</param>
 /// <param name="bcc">BCC</param>
 /// <param name="priority">Priority</param>
 /// <param name="maxNumberOfRecipientsPerEmail">Max number of recipients per email</param>
 /// <param name="attachments">Attachments list</param>
 /// <param name="isBodyHtml">html body flag</param>
 /// <param name="enableSSL">Eanble SSL flag</param>
 /// <param name="iTimeout">Timeout in milliseconds</param>
 public EmailMessage(string messageText, string server, string to, 
     string from, string subject, string cc, string bcc, 
     MailPriority priority, int maxNumberOfRecipientsPerEmail, 
     string attachments,bool isBodyHtml,bool enableSSL, int timeout)
 {
     _body = messageText;
     _server = server;
     _subject = subject;
     _to = new EmailAddress(to);
     _from = new EmailAddress(from);
     _cc = new EmailAddress(cc);
     _bcc = new EmailAddress(bcc);
     _priority = priority;
     _maxNumberOfRecipientsPerEmail = maxNumberOfRecipientsPerEmail;
     _attachments = new EmailAttachments(attachments);
     _isBodyHtml = isBodyHtml;
     _enalbeSSL = enableSSL;
     _timeout = timeout;
 }