summaryrefslogtreecommitdiffstats
path: root/SendGrid/SendGridMail
diff options
context:
space:
mode:
Diffstat (limited to 'SendGrid/SendGridMail')
-rw-r--r--SendGrid/SendGridMail/Mail.csproj12
-rw-r--r--SendGrid/SendGridMail/Transport/Web.cs9
-rw-r--r--SendGrid/SendGridMail/packages.config2
3 files changed, 11 insertions, 12 deletions
diff --git a/SendGrid/SendGridMail/Mail.csproj b/SendGrid/SendGridMail/Mail.csproj
index 4f713d8..9dbcb56 100644
--- a/SendGrid/SendGridMail/Mail.csproj
+++ b/SendGrid/SendGridMail/Mail.csproj
@@ -34,13 +34,11 @@
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
- <Reference Include="RestSharp">
- <HintPath>..\packages\RestSharp.104.1\lib\net4\RestSharp.dll</HintPath>
- <Private>False</Private>
- </Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Net" />
+ <Reference Include="System.Net.Http" />
+ <Reference Include="System.Net.Http.WebRequest" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.ServiceModel.Web" />
<Reference Include="System.Web" />
@@ -61,6 +59,9 @@
<Compile Include="Transport\SMTP.cs" />
<Compile Include="Utils.cs" />
</ItemGroup>
+ <ItemGroup>
+ <None Include="packages.config" />
+ </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
@@ -69,7 +70,4 @@
<Target Name="AfterBuild">
</Target>
-->
- <ItemGroup>
- <None Include="packages.config" />
- </ItemGroup>
</Project> \ No newline at end of file
diff --git a/SendGrid/SendGridMail/Transport/Web.cs b/SendGrid/SendGridMail/Transport/Web.cs
index 6ff89d5..be2c273 100644
--- a/SendGrid/SendGridMail/Transport/Web.cs
+++ b/SendGrid/SendGridMail/Transport/Web.cs
@@ -4,8 +4,8 @@ using System.IO;
using System.Linq;
using System.Net;
using System.Text;
-using System.Xml;
-using RestSharp;
+using System.Xml;
+using System.Net.Http;
namespace SendGridMail.Transport
{
@@ -13,7 +13,7 @@ namespace SendGridMail.Transport
{
#region Properties
//TODO: Make this configurable
- public const String BaseURl = "sendgrid.com/api/";
+ public const String BaseURL = "sendgrid.com/api/";
public const String Endpoint = "mail.send";
public const String JsonFormat = "json";
public const String XmlFormat = "xml";
@@ -50,7 +50,8 @@ namespace SendGridMail.Transport
/// <param name="message"></param>
public void Deliver(ISendGrid message)
{
- var client = Https ? new RestClient("https://" + BaseURl) : new RestClient("http://" + BaseURl);
+ var client = new HttpClient();
+ var url = Https ? new Uri("https://" + BaseURL + Endpoint + ".xml") : new Uri("http://" + BaseURL + Endpoint + ".xml");
var request = new RestRequest(Endpoint + ".xml", Method.POST);
AttachFormParams(message, request);
AttachFiles(message, request);
diff --git a/SendGrid/SendGridMail/packages.config b/SendGrid/SendGridMail/packages.config
index 6b04fa8..1ef8214 100644
--- a/SendGrid/SendGridMail/packages.config
+++ b/SendGrid/SendGridMail/packages.config
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
- <package id="RestSharp" version="104.1" targetFramework="net40" />
+ <package id="Microsoft.Net.Http" version="2.0.20710.0" targetFramework="net45" />
</packages> \ No newline at end of file