AddAttachment from MemoryStream
问题 The SendGrid API docs specify you can add attachments from a Stream. The example it gives uses a FileStream object. I have some blobs in Azure Storage which I'd like to email as attachments. To achieve this I'm trying to use a MemoryStream : var getBlob = blobContainer.GetBlobReferenceFromServer(fileUploadLink.Name); if(getBlob != null) { // Get file as a stream MemoryStream memoryStream = new MemoryStream(); getBlob.DownloadToStream(memoryStream); emailMessage.AddAttachment(memoryStream,