summaryrefslogtreecommitdiffstats
path: root/SendGrid/SendGridMail/Transport
diff options
context:
space:
mode:
Diffstat (limited to 'SendGrid/SendGridMail/Transport')
-rwxr-xr-xSendGrid/SendGridMail/Transport/ITransport.cs5
-rwxr-xr-xSendGrid/SendGridMail/Transport/REST.cs9
-rwxr-xr-xSendGrid/SendGridMail/Transport/SMTP.cs4
3 files changed, 8 insertions, 10 deletions
diff --git a/SendGrid/SendGridMail/Transport/ITransport.cs b/SendGrid/SendGridMail/Transport/ITransport.cs
index 26fccf4..b3a1936 100755
--- a/SendGrid/SendGridMail/Transport/ITransport.cs
+++ b/SendGrid/SendGridMail/Transport/ITransport.cs
@@ -1,7 +1,8 @@
namespace SendGridMail.Transport
{
/// <summary>
- ///
+ /// Encapsulates the transport mechanism so that it can be used in a generic way,
+ /// regardless of the transport type
/// </summary>
public interface ITransport
{
@@ -11,4 +12,4 @@
/// <param name="message">the message to be delivered</param>
void Deliver(ISendGrid message);
}
-}
+} \ No newline at end of file
diff --git a/SendGrid/SendGridMail/Transport/REST.cs b/SendGrid/SendGridMail/Transport/REST.cs
index 7b8c361..614e024 100755
--- a/SendGrid/SendGridMail/Transport/REST.cs
+++ b/SendGrid/SendGridMail/Transport/REST.cs
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
-using System.Collections.Specialized;
using System.IO;
using System.Linq;
using System.Net;
@@ -20,9 +19,7 @@ namespace SendGridMail.Transport
public const String JsonFormat = "json";
public const String XmlFormat = "xml";
- private readonly List<KeyValuePair<String, String>> _query;
private readonly NetworkCredential _credentials;
- private readonly NameValueCollection _queryParameters;
private readonly String _restEndpoint;
private readonly String _format;
#endregion
@@ -69,7 +66,7 @@ namespace SendGridMail.Transport
#region Support Methods
- private HttpClient InitializeTransport(out MultipartEntity multipartEntity, out HttpPost postMethod)
+ internal HttpClient InitializeTransport(out MultipartEntity multipartEntity, out HttpPost postMethod)
{
var client = new HttpClient();
postMethod = new HttpPost(new Uri(_restEndpoint));
@@ -118,7 +115,7 @@ namespace SendGridMail.Transport
}
}
- private List<KeyValuePair<String, String>> FetchFormParams(ISendGrid message)
+ internal List<KeyValuePair<String, String>> FetchFormParams(ISendGrid message)
{
var result = new List<KeyValuePair<string, string>>()
{
@@ -152,7 +149,7 @@ namespace SendGridMail.Transport
return result.Where(r => !String.IsNullOrEmpty(r.Value)).ToList();
}
- private List<KeyValuePair<String, FileInfo>> FetchFileBodies(ISendGrid message)
+ internal List<KeyValuePair<String, FileInfo>> FetchFileBodies(ISendGrid message)
{
if(message.Attachments == null)
return new List<KeyValuePair<string, FileInfo>>();
diff --git a/SendGrid/SendGridMail/Transport/SMTP.cs b/SendGrid/SendGridMail/Transport/SMTP.cs
index 606afcd..a878ce8 100755
--- a/SendGrid/SendGridMail/Transport/SMTP.cs
+++ b/SendGrid/SendGridMail/Transport/SMTP.cs
@@ -72,7 +72,7 @@ namespace SendGridMail.Transport
/// <param name="credentials">Sendgrid user credentials</param>
/// <param name="host">MTA recieving this message. By default, sent through SendGrid.</param>
/// <param name="port">SMTP port 25 is the default. Port 465 can be used for Secure SMTP.</param>
- public static SMTP GenerateInstance(NetworkCredential credentials, String host = SmtpServer, Int32 port = Port)
+ public static SMTP GetInstance(NetworkCredential credentials, String host = SmtpServer, Int32 port = Port)
{
var client = new SmtpWrapper(host, port, credentials, SmtpDeliveryMethod.Network);
return new SMTP(client, credentials, host, port);
@@ -86,7 +86,7 @@ namespace SendGridMail.Transport
/// <param name="host"></param>
/// <param name="port"></param>
/// <returns></returns>
- internal static SMTP GenerateInstance(ISmtpClient client, NetworkCredential credentials, String host = SmtpServer, Int32 port = Port)
+ internal static SMTP GetInstance(ISmtpClient client, NetworkCredential credentials, String host = SmtpServer, Int32 port = Port)
{
return new SMTP(client, credentials, host, port);
}