Mapi message body html has invalid namespace declarations in html tag

Dear Aspose team,

I am opening an msg file and looking at its body html property, but the html tag at its beginning is invalid which is causing subsequent problems in our code.

The problematic html tag looks like this:

Note, that the part after the end of the attribute xmlns:w is syntactically not correct.

I am attaching a pack here with the msg file and the html extracted from it here: bodyhtml.zip (23.2 KB)

The code I use to get to the mapi message is the following:

var msgLoadOptions = new MsgLoadOptions();
msgLoadOptions.PrefferedTextEncoding = Encoding.UTF8;
var mailMessage = MailMessage.Load(filePath, msgLoadOptions);
var mapiMessage = MapiMessage.FromMailMessage(mailMessage);

Please let me know if I can add anything to help fixing the issue.

Best regards,

Gergely Vándor
31347

@gergelyv,

Thank you for contacting Aspose support team.

I have tried to reproduce the scenario using following sample code.

var msgLoadOptions = new MsgLoadOptions();
msgLoadOptions.PrefferedTextEncoding = Encoding.UTF8;
var mailMessage = MailMessage.Load(@"RE MSG Test - 9.msg", msgLoadOptions);
var mapiMessage = MapiMessage.FromMailMessage(mailMessage);
System.IO.File.WriteAllText(@"WriteText.htm", mapiMessage.BodyHtml);

It is observed that using Aspose.Email for .NET 7.10.0, the MapiMessage html body just differs in STRIKE THROUGH text. Rest of the message body is same and no encoding issue is observed. Could you please test the scenario again using latest library and share the feedback? If you observe the same difference, we will discuss issue with our product team accordingly.

Image01.png (93.0 KB)
Image02.png (40.9 KB)
Image03.png (55.7 KB)

Well, the main issue is the syntactically wrong html tag that causes us problems.
This is what we see there:

html xmlns:v=“urn:schemas-microsoft-com:vml” xmlns:o=“urn:schemas-micr=soft-com:office:office” xmlns:w=“urn:schemas-microsoft-com:office:word” =“mlns:m=“http://schemas.microsoft.com/office/2004/12/omml”” xmlns=“http:=/www.w3.org/TR/REC-html40”

As you can see, the attribute after xmlns:w is messed up.
It is reproducible with the latest version of Aspose.Email for .NET.

Please let me know if I can add anything to help fixing the issue.

Best regards,
Gergely Vándor

I can also see this tag, however I am afraid that I could not understand the issue. Could you please explain the issue and share the detail about the mess up? I will share the detail with the product team once detailed description of issue is provided in this regard. We are sorry for the inconvenience caused to you in this regard.

The problem with that tag is that =“mlns:m is not a valid attribute.
I think it’s meant to be xmlns:m.

@gergelyv,

Thank you for sharing the feedback. I have logged this issue under Id:EMAILNET-38890 for further investigation by the product team. You will be automatically notified once any update is received in this regard.