I have an eml file which has a .msg / rfc822 message as an attachment.
I am able to load the eml file and can see the attachment has IsEmbeddedMessage true. I want to load this embedded message as a new message and read the header values
Any pointers how can i load the attachment as a new MailMessage in .net?
I am not a developer by any means, just trying to put a quick and dirty proof of concept together
Can you please share the source EML file along with generated MSG file that fails to open. Please share the requested information so that I may investigate issue on my end.
You can upload the source and generated files in this thread by using upload button. If the files sizes are above 9 MB, you can then upload on some file server and share download link with us.
I have tried to extract the message attachment from EML file and extracted message attachment file is corrupt. A ticket with ID EMAILNET-40062 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be notified once the issue will be fixed.
We have investigated the issue further on our end. The inline message is stored as EML, and when you save from an attachment, it is saved as is - in EML format. In order to save in msg format you have to load it in MailMessage and then save in msg like this:
Before i save the attachment as .msg the properties of the attachment IsEmbeddedMessage is True, ContentType is message/rfc822 and TransferEncoding is Binary
When i try to add the same attachment back to the message the properties are IsEmbeddedMessage is False, ContentType is IsEmbeddedMessage is True, ContentType is message/rfc822 and TransferEncoding is Binary and TransferEncoding is Base64
Please can you advice how can i add the attachment like it was there originally