Inline Attachments in EML File Are Not Showing

I am loading an eml in Aspose mail object.
The eml file has an inline attachment but when I load it shows LinkedResources count 0 and when I export it into pst the inline attachment gets skipped.
Here is the original eml and the code used to load eml file.

f_Objmailmessage = MailMessage.Load(f_tmpEmlPath, new EmlLoadOptions());1edface3-e955-47f5-8d5e-44040ef6c362.zip (88.2 KB)

@navnath44,
Thank you for the issue description. Please check the problem using the latest version of Aspose.Email. If the issue persists, please share the following:

  • code example exporting the EML file to PST
  • screenshot showing how the message looks in PST using Outlook

Here the code I am using add the attachment.
Al other properties and other attachments are ok except inline.

if (f_att.Hidden)
{
p_Objmailmessage.LinkedResources.Add(p_Objmailmessage.AlternateViews[0].LinkedResources[0]);

                            for (int j = 0; j < p_Objmailmessage.LinkedResources.Count; j++)
                            {
                                LinkedResource LinkedAttachments = p_Objmailmessage.LinkedResources[j];
                                if (f_att.FileName.Equals(LinkedAttachments.ContentType.Name))
                                {
                                    // p_Objmailmessage.LinkedResources[j].ContentId = f_att.ContentID;
                                    p_Objmailmessage.LinkedResources[j].ContentId = LinkedAttachments.ContentId; ;
                                    break;
                                }
                            }
                        }

Attaching how it looks like in pst.

PST.png (111.0 KB)

@navnath44,
Unfortunately, I cannot use your code snippet to investigate this case (it contains unknown variables). Please share a comprehensive code example for creating a mail message with an attachment.

Hello,

You don’t need the code snippet as I am just loading the eml in Aspose.Email mail object and then assigning properties to MailMappi object .

@navnath44,
Could you please clarify, how the attached EML file was created?

I am saving the Mime content from Chilkat.
If you could load the eml file in aspose.Email object you will see linked resources are in
p_Objmailmessage.AlternateViews[0].LinkedResources[0] ;

But not in the direct Linked resources(p_Objmailmessage.LinkedResources[0];
)

@navnath44,
I logged the issue with ID EMAILNET-40411 in our tracking system. Our development team will investigate this case. We will inform you of any progress.

@navnath44,
Our development team investigated the issue. The problem is that the Content-Location header in the EML file contains “cid:” characters that should not be. Starting version 21.9, you will be able to add the EML file to a PST file correctly by using a MapiMessage object as shown below:

var message = MailMessage.Load(folderPath + "1edface3-e955-47f5-8d5e-44040ef6c362.eml");
using (var pst = PersonalStorage.Create(folderPath + "test.pst", FileFormatVersion.Unicode))
{
    var folderInfo = pst.RootFolder.AddSubFolder("TestFolder");

    var conversionOptions = new MapiConversionOptions(OutlookMessageFormat.Unicode);
    folderInfo.AddMessage(MapiMessage.FromMailMessage(message, conversionOptions));
}

Documents: Working with Messages in a PST File
API Reference: MailMessage Class, MapiMessage Class

Thank you for the update.
Is 21.9 version released?
I can see only 21.8.1 version.

@navnath44,
Aspose.Email 21.9 for .NET will be released towards the end of September.

Thank you for the update.

The issues you have found earlier (filed as EMAILNET-40411) have been fixed in this update.