Scenario.
I use MailMessage class to read EML files. Sometimes I they have embedded (nested) messages. If original EML file is multi-part MIME message, then I use content type to identify if attachment is embdeded message (“message/rfc822”).
But if original message is in TNEF format, the content type is “application/octet-stream”. In have to load MapiMessage object from MailMessage object and use ObjectData.IsOutlookMessage property in order to identify if it is embedded message. But this approach is RAM consuming.
Better to have some property on Aspose.Email.Mail.Attachment (for example, IsEmbeddedMessage). It will return true in the following cases:
- embedded message inside multi-part MIME EML message (embedded is also multi-part MIME message; Aspose.Email automatically adds .EML extension to these attachments)
- embedded message inside TNEF EML message (Aspose.Email automatically adds .MSG extension to these attachments)
- embedded message inside MSG file
and return false:
- regular MSG/EML attachment in EML (TNEF or muiti-part MIME) message
- regular MSG/EML attachment in MSG message
Hi Alex,
Thank you for writing to Aspose Support team.
If a TNEF message is loaded without preserving the TNEFAttachments, then the attachments are converted to regular attachments and you can identify if the attachment is embedded message (“message/rfc822”). Won’t that be helpful to you in this regard? If not, please share some sample EML files to help us understand your requirements and assist you further.
Hi,
As I said in the initial post:
If original EML file is multi-part MIME message, then I use content type to identify if attachment is embedded message ("message/rfc822").
But if original message is in TNEF format, the content type is "application/octet-stream".
"application/octet-stream" . Not "message/rfc822", thus no means to identify if attachment is embedded message. Tested on Aspose.Email 6.8.0.0.
Thanks,
Alex
Hi Alex,
We have analyzed this scenario and, though attachment’s content type is application/octet-stream, the attachment.Name provides the attachment name as .msg. We have forwarded this requirement to our Product team for further consideration via issue id: EMAILNET-38448 and will update you here once there is some information available in this regard.
Hi Alex,
Thank you for sharing your feedback. We’ll update you here once there is some information available in this regard.