diff options
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();
- }*/
+ }
}
}
|