diff options
author | CJ Buchmann <cj.buchmann@sendgrid.com> | 2012-01-12 16:08:13 -0800 |
---|---|---|
committer | CJ Buchmann <cj.buchmann@sendgrid.com> | 2012-01-12 16:08:13 -0800 |
commit | 48068853163d337f34cd1f971361d6caf97bd7a7 (patch) | |
tree | 4743befca3f7cc2cf6ed4f9f5395fd9c9c8f3c94 /SendGrid/SendGridMail/SendGrid.cs | |
parent | d80dbc622a49ce07b7d2a8a43e275d59550202c3 (diff) | |
download | sendgrid-csharp-48068853163d337f34cd1f971361d6caf97bd7a7.zip sendgrid-csharp-48068853163d337f34cd1f971361d6caf97bd7a7.tar.gz sendgrid-csharp-48068853163d337f34cd1f971361d6caf97bd7a7.tar.bz2 |
Added support for Rest API, to get mailing working. Also added examples to send a simple web api.
Diffstat (limited to 'SendGrid/SendGridMail/SendGrid.cs')
-rwxr-xr-x | SendGrid/SendGridMail/SendGrid.cs | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/SendGrid/SendGridMail/SendGrid.cs b/SendGrid/SendGridMail/SendGrid.cs index 2e238f5..b473d5d 100755 --- a/SendGrid/SendGridMail/SendGrid.cs +++ b/SendGrid/SendGridMail/SendGrid.cs @@ -56,7 +56,6 @@ namespace SendGridMail Bcc = bcc;
message.Subject = subject;
- message.SubjectEncoding = Encoding.GetEncoding(charset);
Text = text;
Html = html;
@@ -235,7 +234,6 @@ namespace SendGridMail }
}
- public Attachment[] Attachments { get; set; }
private List<Attachment> _attachments = new List<Attachment>();
public Attachment[] Attachments
{
@@ -440,12 +438,10 @@ namespace SendGridMail }
}
- if(Attachments != null)
- {
- foreach (Attachment attachment in Attachments)
- {
- message.Attachments.Add(attachment);
- }
+ if (Text != null)
+ { // Encoding.GetEncoding(charset)
+ AlternateView plainView = AlternateView.CreateAlternateViewFromString(Text, null, "text/plain");
+ message.AlternateViews.Add(plainView);
}
if (Html != null)
@@ -453,14 +449,9 @@ namespace SendGridMail AlternateView htmlView = AlternateView.CreateAlternateViewFromString(Html, null, "text/html");
message.AlternateViews.Add(htmlView);
}
-
- if (Text != null)
- {
- AlternateView plainView = AlternateView.CreateAlternateViewFromString(Text, null, "text/plain");
- message.AlternateViews.Add(plainView);
- }
-
- message.BodyEncoding = Encoding.GetEncoding(charset);
+
+ //message.SubjectEncoding = Encoding.GetEncoding(charset);
+ //message.BodyEncoding = Encoding.GetEncoding(charset);
return message;
}
|