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

Free Support Forum - aspose.com

Attachments is not present in any of MailMessage collections: Attachments and LinkedResources

Attached EML message received from Exchange transport agent. When I read EML using the following code, Attachments collection contains only one element and LinkedResources - 0.

MailMessage.Load(@“lmde00BC.original.eml”, new EmlLoadOptions { });

Message contains 2 images (attached screenshot of OutlookSpy).

Why is it happening? Where is the second attachment?

Alex Shloma

Hi Alex,

Thank you for contacting Aspose support team.

Second attachment is actually part of the alternate view. You may please give a try to the following sample code where it displays name of both the attachments.

MailMessage mail = MailMessage.Load("lmde00BC.original.eml", new EmlLoadOptions {});

foreach(Attachment att in mail.Attachments)

foreach(AlternateView view in mail.AlternateViews)
    foreach(LinkedResource res in view.LinkedResources)