diff options
author | Tyler Bischel <tyler.bischel@sendgrid.com> | 2012-01-13 16:18:01 -0800 |
---|---|---|
committer | Tyler Bischel <tyler.bischel@sendgrid.com> | 2012-01-13 16:18:01 -0800 |
commit | 166c48b25b69c1f9db5289ca124df1be88b53cf3 (patch) | |
tree | a79c8067835651ae343e04e2e2787cc17b305b1b /SendGrid/SendGridMail/SendGrid.cs | |
parent | 39d5fb81bec319810565a8b7cf0cbd2e9e985c66 (diff) | |
download | sendgrid-csharp-166c48b25b69c1f9db5289ca124df1be88b53cf3.zip sendgrid-csharp-166c48b25b69c1f9db5289ca124df1be88b53cf3.tar.gz sendgrid-csharp-166c48b25b69c1f9db5289ca124df1be88b53cf3.tar.bz2 |
fixed attachments and REST works!!
Diffstat (limited to 'SendGrid/SendGridMail/SendGrid.cs')
-rwxr-xr-x | SendGrid/SendGridMail/SendGrid.cs | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/SendGrid/SendGridMail/SendGrid.cs b/SendGrid/SendGridMail/SendGrid.cs index 0804099..c8b2a9f 100755 --- a/SendGrid/SendGridMail/SendGrid.cs +++ b/SendGrid/SendGridMail/SendGrid.cs @@ -282,8 +282,8 @@ namespace SendGridMail }
}
- private List<Attachment> _attachments = new List<Attachment>();
- public Attachment[] Attachments
+ private List<String> _attachments = new List<String>();
+ public String[] Attachments
{
get { return _attachments.ToArray(); }
set { _attachments = value.ToList(); }
@@ -297,19 +297,7 @@ namespace SendGridMail public void AddAttachment(String filePath)
{
- var data = new Attachment(filePath, MediaTypeNames.Application.Octet);
- _attachments.Add(data);
- }
-
- public void AddAttachment(Attachment attachment)
- {
- _attachments.Add(attachment);
- }
-
- public void AddAttachment(Stream attachment, ContentType type)
- {
- var data = new Attachment(attachment, type);
- _attachments.Add(data);
+ _attachments.Add(filePath);
}
public IEnumerable<String> GetRecipients()
@@ -490,9 +478,9 @@ namespace SendGridMail if(Attachments != null)
{
- foreach (Attachment attachment in Attachments)
+ foreach (var attachment in Attachments)
{
- message.Attachments.Add(attachment);
+ message.Attachments.Add(new Attachment(attachment, MediaTypeNames.Application.Octet));
}
}
|