title: email attachment from the MemoryStream comes empty
body: <p>_data is a byte[] array of Attachment data.  </p>
  
  <p>When I'm doing this:</p>
  
  <pre><code> var ms = new MemoryStream(_data.Length); 
   ms.Write(_data,0,_data.Length);
   mailMessage.Attachments.Add(new Attachment(ms, attachment.Name));
  </code></pre>
  
  <p>Attachment comes empty. Actually outlook shows the filesize but it's incorrect.</p>
  
  <p>Well, I thought there is a problem in my _data. Then I decided to try this approach:</p>
  
  <pre><code> var ms = new MemoryStream(_data.Length); 
   ms.Write(_data,0,_data.Length);
   fs = new FileStream(@"c:\Temp\"+attachment.Name,FileMode.CreateNew);
   fs.Write(ms.GetBuffer(), 0, ms.GetBuffer().Length);
   fs.Flush();
   fs.Close();
   mailMessage.Attachments.Add(new Attachment(@"c:\Temp\" + attachment.Name));
  </code></pre>
  
  <p>And that works. What's wrong with the first one?</p>