summaryrefslogtreecommitdiffstats
path: root/SendGrid/SendGridMail/SendGrid.cs
diff options
context:
space:
mode:
authorBrandon West <brawest@gmail.com>2014-10-07 14:54:52 -0600
committerBrandon West <brawest@gmail.com>2014-10-07 14:54:52 -0600
commitca91fad22dfec2cd1219267fe979c1d9a33a522e (patch)
tree9c15fbba66ff518d71fa9235bfd6b665c644399d /SendGrid/SendGridMail/SendGrid.cs
parentc8bbb307de6ab5d571797d2f210a0ec0f5531d3a (diff)
parent35c7bf635ab4b6fb9aeade60f4d4e60c2f2f929b (diff)
downloadsendgrid-csharp-ca91fad22dfec2cd1219267fe979c1d9a33a522e.zip
sendgrid-csharp-ca91fad22dfec2cd1219267fe979c1d9a33a522e.tar.gz
sendgrid-csharp-ca91fad22dfec2cd1219267fe979c1d9a33a522e.tar.bz2
Merge pull request #80 from pianomanjh/feature/cc-bcc
add CC, Bcc support
Diffstat (limited to 'SendGrid/SendGridMail/SendGrid.cs')
-rw-r--r--SendGrid/SendGridMail/SendGrid.cs50
1 files changed, 49 insertions, 1 deletions
diff --git a/SendGrid/SendGridMail/SendGrid.cs b/SendGrid/SendGridMail/SendGrid.cs
index 667f94d..1533a46 100644
--- a/SendGrid/SendGridMail/SendGrid.cs
+++ b/SendGrid/SendGridMail/SendGrid.cs
@@ -107,6 +107,32 @@ namespace SendGrid
}
}
+ public MailAddress[] Cc
+ {
+ get { return _message.CC.ToArray(); }
+ set
+ {
+ _message.CC.Clear();
+ foreach (var mailAddress in value)
+ {
+ _message.CC.Add(mailAddress);
+ }
+ }
+ }
+
+ public MailAddress[] Bcc
+ {
+ get { return _message.Bcc.ToArray(); }
+ set
+ {
+ _message.Bcc.Clear();
+ foreach (var mailAddress in value)
+ {
+ _message.Bcc.Add(mailAddress);
+ }
+ }
+ }
+
public String Subject
{
get { return _message.Subject; }
@@ -148,7 +174,29 @@ namespace SendGrid
}
}
- public Dictionary<String, MemoryStream> StreamedAttachments
+ public void AddCc(string address)
+ {
+ var mailAddress = new MailAddress(address);
+ _message.CC.Add(mailAddress);
+ }
+
+ public void AddCc(MailAddress address)
+ {
+ _message.CC.Add(address);
+ }
+
+ public void AddBcc(string address)
+ {
+ var mailAddress = new MailAddress(address);
+ _message.Bcc.Add(mailAddress);
+ }
+
+ public void AddBcc(MailAddress address)
+ {
+ _message.Bcc.Add(address);
+ }
+
+ public Dictionary<String, MemoryStream> StreamedAttachments
{
get { return _streamedAttachments; }
set { _streamedAttachments = value; }