summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Reed (Xerax) <alexreed@outlook.com>2014-02-17 03:03:03 +0000
committerAlex Reed (Xerax) <alexreed@outlook.com>2014-02-17 03:03:03 +0000
commit9ab26dc5e0057ba3c9017175196b1b96a0a53deb (patch)
tree08652475fbd7e8adeb26f816a3bc80259c4156bc
parente2e3087e79f099d7d7330a34f1f3e08c2eb1907b (diff)
downloadsendgrid-csharp-9ab26dc5e0057ba3c9017175196b1b96a0a53deb.zip
sendgrid-csharp-9ab26dc5e0057ba3c9017175196b1b96a0a53deb.tar.gz
sendgrid-csharp-9ab26dc5e0057ba3c9017175196b1b96a0a53deb.tar.bz2
Updated readme to fix #36
-rwxr-xr-xREADME.md15
1 files changed, 15 insertions, 0 deletions
diff --git a/README.md b/README.md
index fa71a5d..ec23ebf 100755
--- a/README.md
+++ b/README.md
@@ -100,6 +100,21 @@ myMessage.Text = "Hello World!";
myMessage.AddAttachment(@"C:\file1.txt");
```
+You can also add attachments from the data's **Stream**. It can be done by calling the same method as above, **AddAttachment**, but by passing in the Stream of the data, and the filename you want it to show as in the message.
+
+```csharp
+SendGrid myMessage = SendGrid.GetInstance();
+myMessage.AddTo("anna@example.com");
+myMessage.From = new MailAddress("john@example.com", "John Smith");
+myMessage.Subject = "Testing the SendGrid Library";
+myMessage.Text = "Hello World!";
+
+using (var attachmentFileStream = new FileStream(@"C:\file.txt", FileMode.Open))
+{
+ message.AddAttachment(attachmentFileStream, "My Cool File.txt");
+}
+```
+
#How to: Use filters to enable footers, tracking, and analytics
SendGrid provides additional email functionality through the use of filters. These are settings that can be added to an email message to enable specific functionality such as click tracking, Google analytics, subscription tracking, and so on. For a full list of filters, see [Filter Settings](http://docs.sendgrid.com/documentation/api/smtp-api/filter-settings/).