title: Create attachment from the stream of the data
body: <p>I am trying to create SendGrid email attachment on-the-fly in C# on Azure. How can I correct the following code where <code>someString</code> is a variable holding the attachment xml content as directly retrieved from the DB?</p>
  
  <pre><code>using (var attachmentFileStream = new FileStream(@someString, FileMode.Open))
  {
      message.AddAttachment(attachmentFileStream, "someattachmentname.xml");
  }
  </code></pre>
  
  <p>It does not seem to like it. I am getting the following errors:  </p>
  
  <ul>
  <li>Illegal characters in path. Access to the path</li>
  <li>'D:\Windows\system32-1' is denied.</li>
  </ul>