diff options
author | CJ Buchmann <cj.buchmann@sendgrid.com> | 2012-01-13 16:22:24 -0800 |
---|---|---|
committer | CJ Buchmann <cj.buchmann@sendgrid.com> | 2012-01-13 16:22:24 -0800 |
commit | e7e6c1b451ab3bfe2454fcef84d497c9e9c36a2f (patch) | |
tree | 3223e59e0f600ceb2aa4fe5beee3899d6a7a72af /SendGrid/SendGridMail/SendGrid.cs | |
parent | 0bb4eb03b1f478df60c1f14da63d42aba8281efe (diff) | |
parent | 166c48b25b69c1f9db5289ca124df1be88b53cf3 (diff) | |
download | sendgrid-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-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 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));
}
}
|