Esempio n. 1
0
 public void BuildMessage_Attachment()
 {
     EmailMessage message = Emailer.BuildMessage(_emailerFilePath, SectionKeyEmailHealthTest, this);
     if (_emailerConfig[SectionKeyEmailHealthTest].Attachments != null && message.Attachments.Attachments != null)
     {
         string source = _emailerConfig[SectionKeyEmailHealthTest].Attachments;
         EmailAttachments emailAttachments = new EmailAttachments(source);
         Assert.AreEqual(emailAttachments.Attachments, message.Attachments.Attachments);
     }
     else
         Assert.IsTrue((_emailerConfig[SectionKeyEmailHealthTest].Attachments == null || _emailerConfig[SectionKeyEmailHealthTest].Attachments.Trim() == string.Empty) &&
             (message.Attachments.Attachments == null || message.Attachments.Attachments.Trim() == string.Empty));
 }
Esempio n. 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;
 }