summaryrefslogtreecommitdiffstats
path: root/SendGrid/Example
diff options
context:
space:
mode:
authorTyler Bischel <tyler.bischel@sendgrid.com>2012-01-13 11:12:32 -0800
committerTyler Bischel <tyler.bischel@sendgrid.com>2012-01-13 11:12:32 -0800
commit4aa172da00a78e5d739cbe003401ccd633ee3d6e (patch)
treed436b3869b1eabd7a0eae04d26d99e9af9556d03 /SendGrid/Example
parent13ea4240f2e863704320ae7c0dc62a6f59d592f0 (diff)
downloadsendgrid-csharp-4aa172da00a78e5d739cbe003401ccd633ee3d6e.zip
sendgrid-csharp-4aa172da00a78e5d739cbe003401ccd633ee3d6e.tar.gz
sendgrid-csharp-4aa172da00a78e5d739cbe003401ccd633ee3d6e.tar.bz2
update attachments, fixed filter formats, added some documentation, made constructors initializable only by factory functions
Diffstat (limited to 'SendGrid/Example')
-rwxr-xr-xSendGrid/Example/Example.csproj4
-rwxr-xr-xSendGrid/Example/RESTAPI.cs4
-rwxr-xr-xSendGrid/Example/SMTPAPI.cs8
-rwxr-xr-xSendGrid/Example/app.config3
4 files changed, 11 insertions, 8 deletions
diff --git a/SendGrid/Example/Example.csproj b/SendGrid/Example/Example.csproj
index 776c740..cb778d1 100755
--- a/SendGrid/Example/Example.csproj
+++ b/SendGrid/Example/Example.csproj
@@ -57,7 +57,9 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
- <None Include="app.config" />
+ <None Include="app.config">
+ <SubType>Designer</SubType>
+ </None>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
diff --git a/SendGrid/Example/RESTAPI.cs b/SendGrid/Example/RESTAPI.cs
index a80c536..f02ea3f 100755
--- a/SendGrid/Example/RESTAPI.cs
+++ b/SendGrid/Example/RESTAPI.cs
@@ -30,7 +30,7 @@ namespace Example
public void SimpleHTMLEmail()
{
//create a new message object
- var message = new SendGrid(new Header());
+ var message = SendGrid.GenerateInstance();
//set the message recipients
@@ -84,7 +84,7 @@ namespace Example
//Utils.PrepareAttachments();
//create an instance of the SMTP transport mechanism
- var restInstance = new REST(new NetworkCredential(_username, _password));
+ var restInstance = REST.GetInstance(new NetworkCredential(_username, _password));
//send the mail
restInstance.Deliver(message);
diff --git a/SendGrid/Example/SMTPAPI.cs b/SendGrid/Example/SMTPAPI.cs
index 6ed10cb..2ee8927 100755
--- a/SendGrid/Example/SMTPAPI.cs
+++ b/SendGrid/Example/SMTPAPI.cs
@@ -25,7 +25,7 @@ namespace Example
public void SimpleHTMLEmail()
{
//create a new message object
- var message = new SendGrid(new Header());
+ var message = SendGrid.GenerateInstance();
//set the message recipients
foreach(string recipient in _to)
@@ -52,7 +52,7 @@ namespace Example
public void SimplePlaintextEmail()
{
//create a new message object
- var message = new SendGrid(new Header());
+ var message = SendGrid.GenerateInstance();
//set the message recipients
foreach(string recipient in _to)
@@ -80,7 +80,7 @@ namespace Example
{
var header = new Header();
//create a new message object
- var message = new SendGrid(header);
+ var message = SendGrid.GenerateInstance();
//set the message recipients
foreach (string recipient in _to)
@@ -114,7 +114,7 @@ namespace Example
{
var header = new Header();
//create a new message object
- var message = new SendGrid(header);
+ var message = SendGrid.GenerateInstance();
//set the message recipients
foreach (string recipient in _to)
diff --git a/SendGrid/Example/app.config b/SendGrid/Example/app.config
index cb2586b..e212038 100755
--- a/SendGrid/Example/app.config
+++ b/SendGrid/Example/app.config
@@ -1,3 +1,4 @@
<?xml version="1.0"?>
<configuration>
-<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
+<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup>
+</configuration>