summaryrefslogtreecommitdiffstats
path: root/SendGrid/SendGridMail/SendGrid.cs
diff options
context:
space:
mode:
authorCJ Buchmann <cj.buchmann@sendgrid.com>2012-01-13 16:22:24 -0800
committerCJ Buchmann <cj.buchmann@sendgrid.com>2012-01-13 16:22:24 -0800
commite7e6c1b451ab3bfe2454fcef84d497c9e9c36a2f (patch)
tree3223e59e0f600ceb2aa4fe5beee3899d6a7a72af /SendGrid/SendGridMail/SendGrid.cs
parent0bb4eb03b1f478df60c1f14da63d42aba8281efe (diff)
parent166c48b25b69c1f9db5289ca124df1be88b53cf3 (diff)
downloadsendgrid-csharp-e7e6c1b451ab3bfe2454fcef84d497c9e9c36a2f.zip
sendgrid-csharp-e7e6c1b451ab3bfe2454fcef84d497c9e9c36a2f.tar.gz
sendgrid-csharp-e7e6c1b451ab3bfe2454fcef84d497c9e9c36a2f.tar.bz2
Merge branch 'us1882-inbetween' of github.com:sendgrid/sendgrid-csharp into us1882-inbetween
Diffstat (limited to 'SendGrid/SendGridMail/SendGrid.cs')
-rwxr-xr-xSendGrid/SendGridMail/SendGrid.cs22
1 files changed, 5 insertions, 17 deletions
diff --git a/SendGrid/SendGridMail/SendGrid.cs b/SendGrid/SendGridMail/SendGrid.cs
index 7237895..0a6a466 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()
@@ -493,9 +481,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));
}
}