Issue Extracting 'To' Field from Emails with Aspose.Email 24.8 and 24.10

Hello Aspose Support,

We are experiencing an issue with the Aspose.Email library where it fails to extract the ‘To’ field from certain emails. We have encountered this issue in both Aspose.Email version 24.8 and 24.10. Below are the details of our problem:

  • Aspose.Email Version: 24.8 and 24.10
  • Programming Language: Java

When attempting to extract the ‘To’ field from emails, the field is consistently returned as null or empty, despite the field being visibly populated when viewing the email in standard email clients. This behavior persists across multiple emails, suggesting a systematic issue with how the library parses the email headers.

We have attached a screenshot showing the ‘To’ field populated in a standard email client for one of the problematic emails.

SMS.PC.00016803.zip (6.9 KB)

@JesseLuna ,

We have tested the issue with versions 24.1, 24.8, and 24.10. There are no changes in “To” field when using different versions.
Additionally, when opening the message in Outlook, the “To” field is empty. An error occurs while loading the message.

Could you please share more information about the issue?
In which application does the message open without errors?

The “To” field is visible in our internal email viewer, as well as in the attachment. I also added a screenshot of what I can see when viewing.

EmailScreenshot.png (9.9 KB)

Could there be a potential parsing issue with non-standard headers.

Here are the steps to reproduce the issue using Aspose.Email:

  1. Load the email file using MailMessage.load.
  2. Attempt to access the ‘To’ field with mailMessage.getTo().
  3. The field returns as null or empty, which is inconsistent with how it appears in our native viewer.

@JesseLuna,

Thank you for the information. We will attempt to reproduce the issue and will update you accordingly.

Hello @JesseLuna ,

The original message has message class ‘REPORT.IPM.Note.IPNRN’.
‘REPORT.IPM.Note.IPNRN’ is a message class in Microsoft Outlook that indicates a read receipt notification for an email.
When a recipient opens and reads your email, the system may automatically generate this notification to inform you that the message has been read.

In Outlook’s message classification system:
‘IPM’ stands for Interpersonal Message (a standard user message).
‘Note’ refers to a regular email message.
‘REPORT’ indicates that it is a system-generated notification related to the status of an email.
Thus, ‘REPORT.IPM.Note.IPNRN’ means a read notification report for a standard email message.

We can read the ‘Recipients’ from the original ‘MapiMessage’:

MapiMessage msg = MapiMessage.load("SMS.PC.00016803.msg");
System.out.println(msg.getRecipients().get_Item(0).getRecipientType());
System.out.println(msg.getRecipients().get_Item(0).getEmailAddress());
System.out.println(msg.getRecipients().get_Item(0).getDisplayName());

Output:

1 - MAPI_TO
/O=EXCHANGELABS/OU=EXCHANGE ADMINISTRATIVE GROUP (000000000000000)/CN=RECIPIENTS/CN=EX:/O=EXCHANGELABS/OU=EXCHANGE ADMINISTRATIVE GROUP (000000000000000)/CN=RECIPIENTS/CN=000000000000000000000000000000000000000000000
To Name

The ‘REPORT.IPM.Note.IPNRN’ message contains the fields ‘PR_RCVD_REPRESENTING_NAME’ and ‘PR_RCVD_REPRESENTING_EMAIL_ADDRESS’.
These fields are used to generate the ‘To’ field in ‘MailMessage’ when converting from ‘MapiMessage’.
In the original message, these fields (‘PR_RCVD_REPRESENTING*’) are missing.
We are considering the use of ‘MAPI Recipients’ to determine the ‘To’ field in case the ‘PR_RCVD_REPRESENTING*’ fields are missing.

Thank you Sergey, this resolved my issue.

You’re welcome! If you need further assistance, feel free to ask.