summaryrefslogtreecommitdiffstats
path: root/SendGrid/Example
diff options
context:
space:
mode:
authorBrandon West <brawest@gmail.com>2013-07-29 09:22:02 -0600
committerBrandon West <brawest@gmail.com>2013-07-29 09:32:49 -0600
commit072cd3ebf52417a275b5180cd1e6841ca4aa86df (patch)
tree1c8c5550dab4b2c6fd62ae9698c5ecaaa2d8f5a0 /SendGrid/Example
parent6d06289c6ce6ce4dfdbd9e65fbc9216c465b0b7b (diff)
downloadsendgrid-csharp-072cd3ebf52417a275b5180cd1e6841ca4aa86df.zip
sendgrid-csharp-072cd3ebf52417a275b5180cd1e6841ca4aa86df.tar.gz
sendgrid-csharp-072cd3ebf52417a275b5180cd1e6841ca4aa86df.tar.bz2
reversion to 1.2.0 since not a breaking change
Diffstat (limited to 'SendGrid/Example')
-rwxr-xr-xSendGrid/Example/Program.cs75
-rw-r--r--[-rwxr-xr-x]SendGrid/Example/Properties/AssemblyInfo.cs4
2 files changed, 37 insertions, 42 deletions
diff --git a/SendGrid/Example/Program.cs b/SendGrid/Example/Program.cs
index 583f304..4c323cf 100755
--- a/SendGrid/Example/Program.cs
+++ b/SendGrid/Example/Program.cs
@@ -1,40 +1,35 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Net;
-using System.Net.Mail;
-using System.Text;
-using SendGridMail;
-using SendGridMail.Transport;
-
-namespace Example
-{
- class Program
- {
- // this code is used for the SMTPAPI examples
- static void Main(string[] args)
- {
- var username = "sgrid_username";
- var password = "sgrid_password";
- var from = "bar@domain.com";
- var to = new List<String>
- {
- "foo@domain.com",
- "raz@domain.com"
- };
-
- //initialize the SMTPAPI example class
- var smtpapi = new SMTPAPI(username, password, from, to);
- var restapi = new WEBAPI(username, password, from, to);
-
- //use this section to test out our Web and SMTP examples!
- smtpapi.SimpleHTMLEmail();
- restapi.SimpleHTMLEmail();
-
- Console.WriteLine("Done!");
- Console.ReadLine();
- }
-
- }
-}
+using System;
+using System.Net;
+using System.Net.Mail;
+using SendGridMail;
+using SendGridMail.Transport;
+
+namespace Example
+{
+ class Program
+ {
+ // this code is used for the SMTPAPI examples
+ static void Main(string[] args)
+ {
+ // Create the email object first, then add the properties.
+ SendGrid myMessage = SendGrid.GetInstance();
+ myMessage.AddTo("anna@example.com");
+ myMessage.From = new MailAddress("john@example.com", "John Smith");
+ myMessage.Subject = "Testing the SendGrid Library";
+ myMessage.Text = "Hello World!";
+
+ // Create credentials, specifying your user name and password.
+ var credentials = new NetworkCredential("username", "password");
+
+ // Create a Web transport for sending email.
+ var transportWeb = Web.GetInstance(credentials);
+
+ // Send the email.
+ transportWeb.Deliver(myMessage);
+
+ Console.WriteLine("Done!");
+ Console.ReadLine();
+ }
+
+ }
+}
diff --git a/SendGrid/Example/Properties/AssemblyInfo.cs b/SendGrid/Example/Properties/AssemblyInfo.cs
index e7c46f8..06a0907 100755..100644
--- a/SendGrid/Example/Properties/AssemblyInfo.cs
+++ b/SendGrid/Example/Properties/AssemblyInfo.cs
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
+[assembly: AssemblyVersion("1.2.0")]
+[assembly: AssemblyFileVersion("1.2.0")]