diff options
author | Tyler Bischel <tyler.bischel@sendgrid.com> | 2012-01-16 23:44:30 -0800 |
---|---|---|
committer | Tyler Bischel <tyler.bischel@sendgrid.com> | 2012-01-16 23:44:30 -0800 |
commit | 85265f48de06629ff7307d642ce765e7b34843a1 (patch) | |
tree | d9dcc93abe5dd4521a48917e26e0f71ca611b756 /SendGrid/Example/Program.cs | |
parent | cc7e8b7a0aae5381899ea1ea4c91e467f170348a (diff) | |
parent | 2cfea4a2829103b413175deac64d62caea141b5c (diff) | |
download | sendgrid-csharp-85265f48de06629ff7307d642ce765e7b34843a1.zip sendgrid-csharp-85265f48de06629ff7307d642ce765e7b34843a1.tar.gz sendgrid-csharp-85265f48de06629ff7307d642ce765e7b34843a1.tar.bz2 |
Merge branch 'us1882' of github.com:sendgrid/sendgrid-csharp
Diffstat (limited to 'SendGrid/Example/Program.cs')
-rwxr-xr-x | SendGrid/Example/Program.cs | 59 |
1 files changed, 8 insertions, 51 deletions
diff --git a/SendGrid/Example/Program.cs b/SendGrid/Example/Program.cs index 87c44a4..c1815b7 100755 --- a/SendGrid/Example/Program.cs +++ b/SendGrid/Example/Program.cs @@ -11,69 +11,26 @@ namespace Example {
class Program
{
- static void Main(String[] args)
- {
- var restInstance = REST.GetInstance(new NetworkCredential("sgrid_username", "sgrid_password"));
-
- //create a new message object
- var message = SendGrid.GenerateInstance();
-
- message.AddTo("cj.buchmann@sendgrid.com");
- message.AddTo("tyler.bischel@sendgrid.com");
- message.AddTo("kyle.partridge@sendgrid.com");
- message.From = new MailAddress("cj.buchmann@sendgrid.com");
- message.Html = "<div>hello world</div>";
- message.Subject = "Hello World SUbject";
- message.AddAttachment(@"C:\Users\Public\Pictures\Sample Pictures\Koala.jpg");
- message.AddAttachment(@"C:\Users\Public\Pictures\Sample Pictures\Jellyfish.jpg");
-
- restInstance.Deliver(message);
-
- Console.WriteLine("Message Sent");
- Console.WriteLine("DONE!");
- Console.ReadLine();
- }
-
// this code is used for the SMTPAPI examples
- /*static void Main(string[] args)
+ static void Main(string[] args)
{
- var username = "cjbuchmann";
- var password = "gadget15";
+ var username = "sgrid_username";
+ var password = "sgrid_password";
var from = "cj.buchmann@sendgrid.com";
var to = new List<String>
{
"cj.buchmann@sendgrid.com"
};
- var bcc = new List<string>
- {
- "eric@sendgrid.com"
- };
-
- var cc = new List<string>
- {
- "eric@sendgrid.com"
- };
-
//initialize the SMTPAPI example class
var smtpapi = new SMTPAPI(username, password, from, to);
+ var restapi = new RESTAPI(username, password, from, to);
- //send a simple HTML encoded email.
- //smtpapi.SimpleHTMLEmail();
-
- //send a simple Plaintext email.
- //smtpapi.SimplePlaintextEmail();
-
- //send a gravatar enabled email.
- //smtpapi.EnableGravatarEmail();
-
- //send an open tracking enabled email.
- //smtpapi.EnableOpenTrackingEmail();
-
- //send an open tracking enabled email.
- smtpapi.EnableClickTrackingEmail();
+ //use this section to test out our REST and SMTP examples!
+ restapi.EnableTemplateEmail();
+ Console.WriteLine("Done!");
Console.ReadLine();
- }*/
+ }
}
}
|