Free Support Forum - aspose.com

Aspose.Email ISSUE when X-Mailer: Apple Mail

Hi,
when the X-Mailer is Apple Mail, the library isn’t able to get the attachments. Below my code:

Aspose.Email.License license = new Aspose.Email.License();
license.SetLicense(“Aspose.Email.lic”);

Aspose.Email.EmlLoadOptions options = new Aspose.Email.EmlLoadOptions();
options.PreserveTnefAttachments = true;
options.PreserveEmbeddedMessageFormat = true;

using (MemoryStream emlStream = new MemoryStream(emlData))
{
Aspose.Email.MailMessage msg = Aspose.Email.MailMessage.Load(emlStream, options);
foreach (Aspose.Email.Attachment att in msg.Attachments)
{
using (MemoryStream ms = new MemoryStream())
{
att.ContentStream.CopyTo(ms);
attachmentsList.Add(att.Nam, ms.ToArray()));
}
}
}

@alessandro.rapisarda,

Please share your sample Email file with us from which you are not able to get the attachments information using the API.

@kashif.iqbal,

thank you for your quick reply. I can’t share the email because it’s from a customer and it would be a privacy violation. I’m trying to generate the same issue from an email sent by me in order to share it to you.

Hello @kashif.iqbal,
we’ve finally generated the issue.
I’m sharing the eml file (inside zip)0002.zip (28.2 KB)
.

I solved the mistery: the images are embedded in the body so I have to use the LinkedResources property.
I was deceived by the MailViewer application that showed me the image as an attachment.

Best regards,
Alex

@alessandro.rapisarda,

Thanks for sharing the update and it is good to know that your issue is resolved now. Please feel free to write to us if you have any further query in this regard.