Wrong attachment count at unpacking eml file



I’m facing an issue when unpack an eml file.
The eml seems to have only one attachment file (named Cablage_NEO_V2.pdf).
But, when unpacking, I find 2 attachments :

  • file Cablage_NEO_V2.pdf
  • file grad.gif

Here’s the code that I run :

    var emlFilename = @"C:\Test\emlFile.eml";
using (var stream = new FileStream(emlFilename, FileMode.Open))
    var loadOptions = new EmlLoadOptions { PreserveTnefAttachments = false };
    using (var message = MailMessage.Load(stream, loadOptions))
        Console.Out.WriteLine($"{message.Attachments.Count} attachment(s) found in file '{Path.GetFileName(emlFilename)}'");
        message.Attachments.ToList().ForEach((att) => Console.Out.WriteLine($"---> Attachment {att.Name}"));

Can someone please tell me why the file grad.gif is processed like an attachement despite of the fact that it hasn’t the attachment content-description value (neither the inline one…)

PS : I’m using Apose.Email v.

Thomas Nk.emlFile.zip (439.5 KB)



Can you please share source file along with generated result so that we may further investigate to help you out.


I’ve edited the first message adding the eml source file.



I have worked with source file and sample code shared by you. I have created an investigation ticket with ID EMAILNET-39590 in our issue tracking system to further investigate to resolve the issue. We will share good news with you soon.


The issues you have found earlier (filed as EMAILNET-39590) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by Adnan.Ahmad