Free Support Forum - aspose.com

Corrupted Recipient Information

We are using Aspose.Email dll (v18.9) to parse Outlook .eml file. While parsing the .eml file, we have noted that the recipient email id is not coming right.
PFA RecipientInformation.png while shows the difference in the recipient information. Due to this, we are unable to get proper recipient information due to this.
PFA the .eml file in the zip file for reference which we used for testing.

Let us know if this issue is replicable at your end, if so, let us know when this can be fixed.

Re [!]Medical Device Change Notification for Registered Device Input Request - MD18668259H.zip (3.1 KB)
RecipientInformation.png (1.8 KB)

@rams2k4,

We reviewed the files that you sent. The header of the EML file contains the CC email address exactly as shown in the attached image.

CC: "Clement_CHUA@"
<hsa.gov.sg "subash_babu@canon.com.sg" subash_babu@canon.com.sg>, "Yoichi
Takesawa" <Yoichi_Takesawa@canon.com.sg>

We hope that this answered your question. Please feel free to reach us if additional information is required.

Hi,

We are using the field ‘Address’ in our program, since the Address in the red seems invalid as compared to the one in green box, we’re getting ‘Invalid Email Address’ error. Hope this clarifies.image001.png (13.9 KB)

@rams2k4,

The sample file that you provided has an invalid email address in the CC field. You can see that in the header information of the file or by opening it using Mozilla Thunderbird or Outlook.

This is not a valid email address format.
"Clement_CHUA@" <hsa.gov.sg "subash_babu@canon.com.sg" subash_babu@canon.com.sg>

The email address should be used like

"Yoichi_Takesawa@canon.com.sg" or "Yoichi Takesawa <Yoichi_Takesawa@canon.com>"

To specify multiple email addresses, you may use a comma to separate them.

Yoichi_Takesawa@canon.com, subash_babu@canon.com.sg

In such scenarios, willl Aspose be fixing this in future release?

@rams2k4,

There is no issue with the API. The API expects the email addresses to be in a standard format. The EML file that you are using has an invalid CC email address. You may use the code given below to fix the source EML file.

MailMessage message = MailMessage.Load("Re [!]Medical Device Change Notification for Registered Device Input Request - MD18668259H.eml", new EmlLoadOptions());
MailAddressCollection CC = new MailAddressCollection();
CC.Add("Clement_CHUA@hsa.gov.sg");
CC.Add("subash_babu@canon.com.sg");
CC.Add("Yoichi_Takesawa@canon.com.sg");
message.CC = CC;
MapiMessage mapiMessage = MapiMessage.FromMailMessage(message);
mapiMessage.Save("GeneratedFile.eml", EmlSaveOptions.DefaultEml);

The code above will generate a new file with correct email addresses. You may use the new “GeneratedFile.eml” in your code. We have attached the generated EML file for your convenience.
GeneratedFile.zip (3.0 KB)
Please feel free to reach us if additional information is required.