title: Get file to send as attachment from byte array
body: <p>I have an ASP.NET MVC application that has to send an email to a list of recipients with an attachment detailing a specific "Project". I get the details for this from a report by making use of SQL Server Reporting Services (SSRS).</p>
  
  <p>I've never really used SSRS before, but I received some code from a colleague where he used it. What he does with the report is he downloads it in the browser to the client's machine. So, if I don't do that I sit with a byte array containing the report data.</p>
  
  <p>Is there a way I can send this as an attachment without first physically writing the file to the filesystem of the server? The report will either be in excel format or a pdf.</p>
  
  <p><strong>Edit:</strong> I am using <code>SmtpClient</code> to send the email's.</p>