summaryrefslogtreecommitdiffstats
path: root/SendGrid/Example/RESTAPI.cs
diff options
context:
space:
mode:
authorCJ Buchmann <cj.buchmann@sendgrid.com>2012-01-12 19:24:30 -0800
committerCJ Buchmann <cj.buchmann@sendgrid.com>2012-01-12 19:24:30 -0800
commit13ea4240f2e863704320ae7c0dc62a6f59d592f0 (patch)
tree93774191f19422b6e61e4c16916f3f0c4ea1a7ce /SendGrid/Example/RESTAPI.cs
parent48068853163d337f34cd1f971361d6caf97bd7a7 (diff)
downloadsendgrid-csharp-13ea4240f2e863704320ae7c0dc62a6f59d592f0.zip
sendgrid-csharp-13ea4240f2e863704320ae7c0dc62a6f59d592f0.tar.gz
sendgrid-csharp-13ea4240f2e863704320ae7c0dc62a6f59d592f0.tar.bz2
Got All parts of the REST api working, except file attachments.
Diffstat (limited to 'SendGrid/Example/RESTAPI.cs')
-rwxr-xr-xSendGrid/Example/RESTAPI.cs17
1 files changed, 16 insertions, 1 deletions
diff --git a/SendGrid/Example/RESTAPI.cs b/SendGrid/Example/RESTAPI.cs
index ca4e507..a80c536 100755
--- a/SendGrid/Example/RESTAPI.cs
+++ b/SendGrid/Example/RESTAPI.cs
@@ -1,4 +1,5 @@
using System;
+using System.Linq;
using System.Collections.Generic;
using System.Net;
using System.Net.Mail;
@@ -57,7 +58,19 @@ namespace Example
message.AddCc(cc);
}
}
-
+
+ var headers = new Dictionary<String, String>
+ {
+ {"key1", "value1"},
+ {"key2", "value2"},
+ {"icanhazcheeze", "kthnxbye"}
+ };
+
+ message.AddHeaders(headers);
+
+ //var replyTo = new List<MailAddress> { new MailAddress("tyler.bischel@sendgrid.com") };
+
+ //message.ReplyTo = replyTo.ToArray();
//set the sender
message.From = new MailAddress(_from);
@@ -68,6 +81,8 @@ namespace Example
//set the message subject
message.Subject = "Hello World Simple Test";
+ //Utils.PrepareAttachments();
+
//create an instance of the SMTP transport mechanism
var restInstance = new REST(new NetworkCredential(_username, _password));