summaryrefslogtreecommitdiffstats
path: root/SendGrid/Example
diff options
context:
space:
mode:
Diffstat (limited to 'SendGrid/Example')
-rw-r--r--[-rwxr-xr-x]SendGrid/Example/Example.csproj2
-rwxr-xr-xSendGrid/Example/Program.cs31
-rw-r--r--[-rwxr-xr-x]SendGrid/Example/Properties/AssemblyInfo.cs4
-rw-r--r--[-rwxr-xr-x]SendGrid/Example/app.config0
4 files changed, 17 insertions, 20 deletions
diff --git a/SendGrid/Example/Example.csproj b/SendGrid/Example/Example.csproj
index 1f85cc2..97a47b4 100755..100644
--- a/SendGrid/Example/Example.csproj
+++ b/SendGrid/Example/Example.csproj
@@ -24,6 +24,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
+ <Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<PlatformTarget>x86</PlatformTarget>
@@ -33,6 +34,7 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
+ <Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
diff --git a/SendGrid/Example/Program.cs b/SendGrid/Example/Program.cs
index 29b02e6..4c323cf 100755
--- a/SendGrid/Example/Program.cs
+++ b/SendGrid/Example/Program.cs
@@ -1,10 +1,6 @@
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;
@@ -15,22 +11,21 @@ namespace Example
// 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"
- };
+ // 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!";
- //initialize the SMTPAPI example class
- var smtpapi = new SMTPAPI(username, password, from, to);
- var restapi = new WEBAPI(username, password, from, to);
+ // Create credentials, specifying your user name and password.
+ var credentials = new NetworkCredential("username", "password");
- //use this section to test out our Web and SMTP examples!
- smtpapi.SimpleHTMLEmail();
- restapi.SimpleHTMLEmail();
+ // 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")]
diff --git a/SendGrid/Example/app.config b/SendGrid/Example/app.config
index e212038..e212038 100755..100644
--- a/SendGrid/Example/app.config
+++ b/SendGrid/Example/app.config