title: AddAttachment from MemoryStream
body: <p>The SendGrid API docs specify you can add attachments from a Stream. <a href="https://github.com/sendgrid/sendgrid-csharp#how-to-add-an-attachment" rel="noreferrer">The example it gives uses a <code>FileStream</code> object</a>.</p>
  
  <p>I have some blobs in Azure Storage which I'd like to email as attachments. To achieve this I'm trying to use a <code>MemoryStream</code>:</p>
  
  <pre><code>var getBlob = blobContainer.GetBlobReferenceFromServer(fileUploadLink.Name);
  if(getBlob != null)
  {
    // Get file as a stream
    MemoryStream memoryStream = new MemoryStream();
    getBlob.DownloadToStream(memoryStream);
    emailMessage.AddAttachment(memoryStream, fileUploadLink.Name);
  }
  emailTransport.Deliver(emailMessage);
  </code></pre>
  
  <p>It sends fine but when the email arrives, the attachment appears to be there but it's actually empty. Looking at the email source, there is no content for the attachment.</p>
  
  <p>Is using a <code>MemoryStream</code> a known limitation when using the SendGrid C# API to send attachments? Or should I be approaching this in some other way?</p>