I am trying to extract the attachments from an email mht file and write to separte mht files.I used the code in this link Extracting mht files to extract and write the attachments to a file. Apparently I am unable to open the output mht files in the case of Content/Type: application/pdf and application/octet-stream. Below is the format of the output mht file which I am not able to open in IE. I am wondering why I am unable to open the file in IE. Any help or suggestions would be useful. Thanks.
MIME-Version: 1.0
Content-Type: multipart/related; type="text/html";
boundary="===============0805110039=="
--===============0805110039==
Content-Type: application/pdf
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-ID: <abcd.pdf>
<Payload>
--===============0805110039==--