Tuesday, May 28, 2013

Apllication/OctetStream mime data to another mime type

Apllication/OctetStream mime data to another mime type

this is my scenario: I'm writing code to download email from a server saving them in a local folder.
Folders structure:
Mails
MailNumber folder
eml file (the mail)
attachment folder
attachments
MailNumber folder
.......
So, the mail can have another mails attached, and most of the times they are the type "System.Message" but sometimes they are coded like "application/octetstream". I need to convert them in mail because I need to create a new "MailNumber folder" for them with their attachment. A solution is that I save the object on local filesystem and then I get the eml file and get the contents. But isn't there a way to convert directly the application/octetstream mime to another type?