title: Openpop.NET retriving attachment to specific folder
body: <p>I am trying to retrieve an email attachment and save it to specific directory in filesystem using the code below.</p>
  
  <pre><code>Dim objMail As Message = New Message(Encoding.ASCII.GetBytes(strMessage))
  
  For Each att In objMail.FindAllAttachments()
      Dim Stream as FileStream = New FileStream("D:\XX\" &amp; att.FileName.ToString(), 
          FileMode.Create)
      Dim BinaryStream As New BinaryWriter(Stream)
      BinaryStream.Write(BitConverter.ToString(att.Body))
      BinaryStream.Close()
  Next
  </code></pre>
  
  <p>I have also tried <code>att.GetBodyasText()</code></p>
  
  <p>Using this code I am able to save attachment file in desired folder. But while opening a file, I am getting errorL</p>
  
  <blockquote>
    <p>File is not in proper Format or not Decoded Properly.</p>
  </blockquote>
  
  <p>I am new to MIME encoding/decoding.</p>