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 | 29ccc23f23a19e917f5de932585d9b5d7583c0b5 (patch) | |
tree | 5a3fd5248c1d79c66efd051ebb026906233d4d5a /SendGrid/SendGridMail/SendGrid.cs | |
parent | 2c5852543af4cb5ca58a177d62044eb1152f731e (diff) | |
download | sendgrid-csharp-29ccc23f23a19e917f5de932585d9b5d7583c0b5.zip sendgrid-csharp-29ccc23f23a19e917f5de932585d9b5d7583c0b5.tar.gz sendgrid-csharp-29ccc23f23a19e917f5de932585d9b5d7583c0b5.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));
}
}
|