Kashif,
I attached a file called "message.txt". You'll have to manually change its extension to ".msg" (when I tried to upload the file "message.msg" it didn't allow me for the proprietary reason? something like that)
I'll give you a bit of a background about this issue.
We created a mailbox dedicated to a specific purpose. We're going to receive email messages there, and some emails will have attachments. We'll save all the emails in ".eml" format and we want to save all the attachments in their original format (if they are .txt, .msg, .png, etc, we want to keep them that way).
In the scenario below, Aspose will automatically convert the ".msg" attachment to ".eml".
1. Open Outlook
2. Send "New E-mail"
3. Receiver, subject, body - anything in them
4. Drag & drop an email (I have it on my desktop and its called "quick test.msg") to the new email.
5. Click on the "Format Text" option at the top
6. Select "Rich Text" option in the "Format" group.
7. Send the email
We created a connection using Aspose (POP3 with SSL but it doesn't matter if it's POP3 or IMAP) to the mailbox that received the email.
Using Aspose we tried to download that email that we just received (it's the only email in the mailbox)
After fetching the email using the FetchMessage() method, the attachment name became "quick test.eml" instead of "quick test.msg". Now, because we created this test we do know the email was originally sent as ".msg". But the emails could come from other people and we don't know if they sent them as ".msg" or ".eml". That's why we want to keep their original format and it's impossible for us to know how the email was sent.
The file attached is the email I tested this with. Please remember that if you load the message from the file, it's different than how it's originally downloaded. In the case when downloaded, I explained above what happens. In the case when loaded from the file, the attachment name won't even have an extension. The attachment name will be "quick test" and that's it. I understand that we could get the format from ContentType.MediaType, but that doesn't actually tells us if it was originally ".eml" or ".msg". I don't think this is actually normal behavior.
I think the best way for you to test this is follow the steps above. If you try to load the email from the file I attached, it won't behave the same.
Also, if you follow the exact steps as above but NOT format the email as "Rich Text", the email will be downloaded successfully as ".msg" as it was originally sent. My opinion is that Aspose has a bug when handling emails sent in "Rich Text Format".
Thank you for your assistance on this one