summaryrefslogtreecommitdiffstats
path: root/SendGrid/SendGridMail/Transport/Web.cs
diff options
context:
space:
mode:
authorJosh Huber <josh.huber@pdp.com>2014-08-15 18:30:16 -0700
committerJosh Huber <josh.huber@pdp.com>2014-08-15 18:30:16 -0700
commit35c7bf635ab4b6fb9aeade60f4d4e60c2f2f929b (patch)
tree72e18dfd34e8cf50d89caa7a7122fe5098926dd6 /SendGrid/SendGridMail/Transport/Web.cs
parent64e62585587bd9c2ef59c6c03f97af67c550b560 (diff)
downloadsendgrid-csharp-35c7bf635ab4b6fb9aeade60f4d4e60c2f2f929b.zip
sendgrid-csharp-35c7bf635ab4b6fb9aeade60f4d4e60c2f2f929b.tar.gz
sendgrid-csharp-35c7bf635ab4b6fb9aeade60f4d4e60c2f2f929b.tar.bz2
add CC, Bcc support
Diffstat (limited to 'SendGrid/SendGridMail/Transport/Web.cs')
-rw-r--r--SendGrid/SendGridMail/Transport/Web.cs11
1 files changed, 11 insertions, 0 deletions
diff --git a/SendGrid/SendGridMail/Transport/Web.cs b/SendGrid/SendGridMail/Transport/Web.cs
index f241256..6b7a84d 100644
--- a/SendGrid/SendGridMail/Transport/Web.cs
+++ b/SendGrid/SendGridMail/Transport/Web.cs
@@ -189,6 +189,17 @@ namespace SendGrid
.Concat(message.To.ToList().Select(a => new KeyValuePair<String, String>("toname[]", a.DisplayName)))
.ToList();
}
+
+ if (message.Cc != null)
+ {
+ result.AddRange(message.Cc.Select(c => new KeyValuePair<string, string>("cc[]", c.Address)));
+ }
+
+ if (message.Bcc != null)
+ {
+ result.AddRange(message.Bcc.Select(c => new KeyValuePair<string, string>("bcc[]", c.Address)));
+ }
+
if (message.GetEmbeddedImages().Count > 0) {
result = result.Concat(message.GetEmbeddedImages().ToList().Select(x => new KeyValuePair<String, String>(string.Format("content[{0}]", x.Key), x.Value)))
.ToList();