diff options
Diffstat (limited to 'SendGrid/Example/Program.cs')
-rw-r--r-- | SendGrid/Example/Program.cs | 46 |
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 |