Пример #1
0
 public SmartEmail(EmailAddress[] to, EmailAddress[] cc, EmailAddress[] bcc, Attachment[] attachments,
     IDictionary<string, object> data, bool addRecipientsToList)
 {
     To = to;
     CC = cc;
     BCC = bcc;
     Attachments = attachments;
     Data = data;
     AddRecipientsToList = addRecipientsToList;
 }
Пример #2
0
 public ClassicEmail(EmailAddress from, EmailAddress replyTo, EmailAddress[] to, EmailAddress[] cc,
     EmailAddress[] bcc, string subject, string html, string text, Image[] images, Attachment[] attachments,
     bool trackOpens, bool trackClicks, bool inlineCss, string @group, string addRecipientsToListId)
 {
     From = from;
     ReplyTo = replyTo;
     To = to;
     CC = cc;
     BCC = bcc;
     Subject = subject;
     Html = html;
     Text = text;
     Images = images;
     Attachments = attachments;
     TrackOpens = trackOpens;
     TrackClicks = trackClicks;
     InlineCss = inlineCss;
     Group = @group;
     AddRecipientsToListId = addRecipientsToListId;
 }
Пример #3
0
        public RateLimited <RecipientStatus[]> Send(string clientId, EmailAddress from, string subject, string html, string text, ConsentToTrack consentToTrack, EmailAddress replyTo = null, EmailAddress[] cc = null, EmailAddress[] bcc = null, Image[] images = null, Attachment[] attachments = null, bool trackOpens = true, bool trackClicks = true, bool inlineCss = true, string @group = null, string addRecipientsToListId = null, params EmailAddress[] to)
        {
            if (clientId == null)
            {
                throw new ArgumentNullException("clientId");
            }

            return(Send(new ClassicEmail(from, replyTo, to, cc, bcc, subject, html, text, images, attachments, trackOpens, trackClicks, inlineCss, @group, addRecipientsToListId, consentToTrack), this.CreateQueryString(clientId)));
        }
Пример #4
0
 public RateLimited<RecipientStatus[]> Send(Guid smartEmailId, EmailAddress[] cc = null, EmailAddress[] bcc = null, Attachment[] attachments = null, IDictionary<string, object> data = null, bool addRecipientsToList = true, params EmailAddress[] to)
 {
     return Send(smartEmailId, new SmartEmail(to, cc, bcc, attachments, data, addRecipientsToList), new NameValueCollection());
 }
Пример #5
0
        public IMessageBuilder To(EmailAddress[] to)
        {
            if(to == null) throw new ArgumentNullException("to");
            if(to.Length == 0) throw new ArgumentException("Cannot be empty", "to");

            this.to.AddRange(to);
            return this;
        }
Пример #6
0
        public IMessageBuilder To(EmailAddress to)
        {
            if(to == null) throw new ArgumentNullException("to");

            this.to.Add(to);
            return this;
        }
Пример #7
0
        public IMessageBuilder ReplyTo(EmailAddress replyTo)
        {
            if(replyTo == null) throw new ArgumentNullException("replyTo");

            this.replyTo = replyTo;
            return this;
        }
Пример #8
0
        public IMessageBuilder From(EmailAddress from)
        {
            if(from == null) throw new ArgumentNullException("from");

            this.from = from;
            return this;
        }
Пример #9
0
        public IMessageBuilder CC(EmailAddress[] cc)
        {
            if(cc == null) throw new ArgumentNullException("cc");
            if (cc.Length == 0) throw new ArgumentException("Cannot be empty", "cc");

            this.cc.AddRange(cc);
            return this;
        }
Пример #10
0
        public IMessageBuilder CC(EmailAddress cc)
        {
            if(cc == null) throw new ArgumentNullException("cc");

            this.cc.Add(cc);
            return this;
        }
Пример #11
0
 public RateLimited <RecipientStatus[]> Send(EmailAddress from, string subject, string html, string text, EmailAddress replyTo = null, EmailAddress[] cc = null, EmailAddress[] bcc = null, Image[] images = null, Attachment[] attachments = null, bool trackOpens = true, bool trackClicks = true, bool inlineCss = true, string @group = null, string addRecipientsToListId = null, params EmailAddress[] to)
 {
     return(Send(new ClassicEmail(from, replyTo, to, cc, bcc, subject, html, text, images, attachments, trackOpens, trackClicks, inlineCss, @group, addRecipientsToListId), this.CreateQueryString()));
 }
Пример #12
0
        public RateLimited<RecipientStatus[]> Send(string clientId, EmailAddress from, string subject, string html, string text, EmailAddress replyTo = null, EmailAddress[] cc = null, EmailAddress[] bcc = null, Image[] images = null, Attachment[] attachments = null, bool trackOpens = true, bool trackClicks = true, bool inlineCss = true, string @group = null, string addRecipientsToListId = null, params EmailAddress[] to)
        {
            if (clientId == null) throw new ArgumentNullException("clientId");

            return Send(new ClassicEmail(from, replyTo, to, cc, bcc, subject, html, text, images, attachments, trackOpens, trackClicks, inlineCss, @group, addRecipientsToListId), this.CreateQueryString(clientId));
        }
Пример #13
0
 public static string ToString(EmailAddress email)
 {
     return email == null ? null : email.ToString();
 }