Ejemplo n.º 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;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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)));
        }
Ejemplo n.º 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());
 }
Ejemplo n.º 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;
        }
Ejemplo n.º 6
0
        public IMessageBuilder To(EmailAddress to)
        {
            if(to == null) throw new ArgumentNullException("to");

            this.to.Add(to);
            return this;
        }
Ejemplo n.º 7
0
        public IMessageBuilder ReplyTo(EmailAddress replyTo)
        {
            if(replyTo == null) throw new ArgumentNullException("replyTo");

            this.replyTo = replyTo;
            return this;
        }
Ejemplo n.º 8
0
        public IMessageBuilder From(EmailAddress from)
        {
            if(from == null) throw new ArgumentNullException("from");

            this.from = from;
            return this;
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 10
0
        public IMessageBuilder CC(EmailAddress cc)
        {
            if(cc == null) throw new ArgumentNullException("cc");

            this.cc.Add(cc);
            return this;
        }
Ejemplo n.º 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()));
 }
Ejemplo n.º 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));
        }
Ejemplo n.º 13
0
 public static string ToString(EmailAddress email)
 {
     return email == null ? null : email.ToString();
 }