We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Aspose is detecting image attachments in a MSG that do not have any regular attachments

Hello,

If a MSG has any attachments my goal is to extract them and save them in a given location. But there is a problema with some MSG files that do not have any attachments but the Aspose.Email still detects several imagens as attachments and the ways to verify if those are inline attachments or embedded to not work.
I tried with IsEmbeddedMessage property but it returns false:

//Create an instance of MailMessage and load an email file
mailMsg = Aspose.Email.MailMessage.Load(fileStream);

//Get all the email file attachments
foreach (Aspose.Email.Attachment attachment in mailMsg.Attachments)
{
bool isEmbeddedAttachment = attachment.IsEmbeddedMessage;
if (isEmbeddedAttachment)
continue;

//Save the attachment file
attachment.Save(path);

}

Also tried with Aspose.Email.Mapi.MapiAttachment using the “IsInlineAttachment” example provided by you in your documentation:
https://docs.aspose.com/email/net/differentiating-between-inline-and-regular-attachments/
also with the same result unfortunately.

This problem can also be seen using your online converter (MSG to PDF), you will notice many imagens will show that are not present in the original MSG not even present as attachments:
https://products.aspose.app/email/conversion/msg-to-pdf

I provide this msg file that you will be able to reproduce the problem:
MSG without attachements.zip (133.9 KB)

This problem do not happen in older Aspose.Email versions, can you please fix it?

Thanks

@duvidasAspose

We have logged this problem in our issue tracking system as EMAILNET-40730. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.