summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--SendGrid/Example/Example.csproj12
-rw-r--r--SendGrid/SendGridMail/Properties/AssemblyInfo.cs4
-rw-r--r--SendGrid/SendGridMail/Transport/Web.cs8
3 files changed, 15 insertions, 9 deletions
diff --git a/SendGrid/Example/Example.csproj b/SendGrid/Example/Example.csproj
index 8152179..f604aaa 100644
--- a/SendGrid/Example/Example.csproj
+++ b/SendGrid/Example/Example.csproj
@@ -60,6 +60,12 @@
<ItemGroup>
<WCFMetadata Include="Service References\" />
</ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\SendGridMail\Mail.csproj">
+ <Project>{3c687bef-ff50-44ad-8315-2d4237281af8}</Project>
+ <Name>Mail</Name>
+ </ProjectReference>
+ </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
@@ -69,10 +75,4 @@
<Target Name="AfterBuild">
</Target>
-->
- <ItemGroup>
- <ProjectReference Include="..\SendGridMail\Mail.csproj">
- <Project>{3C687BEF-FF50-44AD-8315-2D4237281AF8}</Project>
- <Name>Mail</Name>
- </ProjectReference>
- </ItemGroup>
</Project> \ No newline at end of file
diff --git a/SendGrid/SendGridMail/Properties/AssemblyInfo.cs b/SendGrid/SendGridMail/Properties/AssemblyInfo.cs
index dbff93a..c2d2a11 100644
--- a/SendGrid/SendGridMail/Properties/AssemblyInfo.cs
+++ b/SendGrid/SendGridMail/Properties/AssemblyInfo.cs
@@ -48,5 +48,5 @@ using System.Runtime.InteropServices;
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("4.0.0")]
-[assembly: AssemblyFileVersion("4.0.0")] \ No newline at end of file
+[assembly: AssemblyVersion("4.1.0")]
+[assembly: AssemblyFileVersion("4.1.0")] \ No newline at end of file
diff --git a/SendGrid/SendGridMail/Transport/Web.cs b/SendGrid/SendGridMail/Transport/Web.cs
index 9784097..1458da8 100644
--- a/SendGrid/SendGridMail/Transport/Web.cs
+++ b/SendGrid/SendGridMail/Transport/Web.cs
@@ -5,8 +5,10 @@ using System.Linq;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
+using System.Reflection;
using System.Threading.Tasks;
using System.Xml;
+using Exceptions;
using SendGrid.SmtpApi;
// ReSharper disable MemberCanBePrivate.Global
@@ -45,7 +47,8 @@ namespace SendGrid
BaseAddress = new Uri("https://" + BaseUrl)
};
- client.DefaultRequestHeaders.TryAddWithoutValidation("User-Agent", "sendgrid/4.0.1;csharp");
+ var version = Assembly.GetExecutingAssembly().GetName().Version.ToString();
+ client.DefaultRequestHeaders.TryAddWithoutValidation("User-Agent", "sendgrid/" + version + ";csharp");
var content = new MultipartFormDataContent();
AttachFormParams(message, content);
@@ -65,6 +68,9 @@ namespace SendGrid
BaseAddress = new Uri("https://" + BaseUrl)
};
+ var version = Assembly.GetExecutingAssembly().GetName().Version.ToString();
+ client.DefaultRequestHeaders.TryAddWithoutValidation("User-Agent", "sendgrid/" + version + ";csharp");
+
var content = new MultipartFormDataContent();
AttachFormParams(message, content);
AttachFiles(message, content);