summaryrefslogtreecommitdiffstats
path: root/SendGrid/Example/Program.cs
diff options
context:
space:
mode:
authorRobin J <me@rbin.co>2014-02-17 16:11:42 +0000
committerRobin J <me@rbin.co>2014-02-17 16:11:42 +0000
commit849ece5e6b93b0fb965f6d52a78958ef1a014f9a (patch)
tree08652475fbd7e8adeb26f816a3bc80259c4156bc /SendGrid/Example/Program.cs
parent66094a4e8321e834229a70084a6235360e52155c (diff)
parent9ab26dc5e0057ba3c9017175196b1b96a0a53deb (diff)
downloadsendgrid-csharp-849ece5e6b93b0fb965f6d52a78958ef1a014f9a.zip
sendgrid-csharp-849ece5e6b93b0fb965f6d52a78958ef1a014f9a.tar.gz
sendgrid-csharp-849ece5e6b93b0fb965f6d52a78958ef1a014f9a.tar.bz2
Merge pull request #44 from Xerax/master
Code clean-up and tweaks
Diffstat (limited to 'SendGrid/Example/Program.cs')
-rw-r--r--SendGrid/Example/Program.cs46
1 files changed, 23 insertions, 23 deletions
diff --git a/SendGrid/Example/Program.cs b/SendGrid/Example/Program.cs
index 4ebb895..7fb0960 100644
--- a/SendGrid/Example/Program.cs
+++ b/SendGrid/Example/Program.cs
@@ -5,30 +5,30 @@ using SendGridMail;
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!";
+ internal class Program
+ {
+ // this code is used for the SMTPAPI examples
+ private static void Main()
+ {
+ // Create the email object first, then add the properties.
+ var 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 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);
+ // Create a Web transport for sending email.
+ var transportWeb = Web.GetInstance(credentials);
- // Send the email.
- transportWeb.DeliverAsync(myMessage);
+ // Send the email.
+ if (transportWeb != null)
+ transportWeb.DeliverAsync(myMessage);
- Console.WriteLine("Done!");
- Console.ReadLine();
- }
-
- }
-}
+ Console.WriteLine("Done!");
+ Console.ReadLine();
+ }
+ }
+} \ No newline at end of file