We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

MhtMessageFormatter gets confues by german special characters


i’m using Aspose.Email.dll for email to pdf conversion.

1. Reading email in *.msg format
2. Formatting email via MhtMessageFormatter
3. Save email in *.mhtml Format
4. Reading *.mhtml document via Aspose.Words.dll
5. Save word document as pdf file.

It seems Aspose.Email.dll gets confused by german special characters (this is in step 3).

Example Code:

Aspose.Email.License mailLic = new Aspose.Email.License();

Aspose.Words.License wordLic = new Aspose.Words.License();

MailMessage msg= MailMessage.Load(“c:\temp\demo.msg”);

MailMessageSaveOptions mailSaveOptions = MailMessageSaveOptions.None;
MhtMessageFormatter mailFormatter = new MhtMessageFormatter();
mailFormatter.FromFormat = "<span class=“headerLineTitle”>Von:<span class=“headerLineText”> {0} "; //Wichtig: korrekte Anführungszeichen " benutzen
mailFormatter.DateTimeFormat = “dd.MM.yyyy HH:mm”;
mailFormatter.SentFormat = “<span class=“headerLineTitle”>Gesendet:<span class=“headerLineText”> {0}
mailFormatter.ToFormat = “<span class=“headerLineTitle”>An:<span class=“headerLineText”> {0}
mailFormatter.SubjectFormat = “<span class=“headerLineTitle”>Betreff:<span class=“headerLineText”> {0}
mailFormatter.BccFormat = “<span class=“headerLineTitle”>Bcc:<span class=“headerLineText”> {0}
mailFormatter.CcFormat = “<span class=“headerLineTitle”>Cc:<span class=“headerLineText”> {0}
mailFormatter.AttachmentFormat = “<span class=“headerLineTitle”>Anlagen:<span class=“headerLineText”> {0}


msg.Save(“c:\temp\demo.mht”, MailMessageSaveType.MHtmlFromat, mailSaveOptions);

Aspose.Words.LoadOptions loadOpt= new Aspose.Words.LoadOptions();
loadOpt.LoadFormat = LoadFormat.Mhtml;
Aspose.Words.Document doc = new Document(“c:\temp\demo.mht”, loadOpt);
doc.Save(“c:\temp\demo.pdf”, SaveFormat.Pdf);

My plattform:
Windows 8 64 Bit
internal bugid#4917

Hi Martin,

Thank you for considering Aspose.Email as part of your solutions.

I was able to reproduce this issue at my end using the latest version of Aspose.Email for .NET 2.8.0 and have logged it in our bug tracking system under issue id: NETWORKNET-33733. Development team will look into it and once we have any information regarding the resolution of this issue, we’ll update you here via this thread.

If you have any other query/inquiry regarding Aspose.Email, please feel free to post to us. We’ll try to assist you further as soon as possible.

The attribute Email.BodyHtml shows also wrong special characters. The problem is not isolated to the MhtMessageFormatter class.

Is it true, that the problem is caused from Emails with Email.BodyContentType = RTF ? Or are there other factors?

Hi Martin,

During my investigation, I was able to reproduce this issue even without using MhtMessageFormatter irrelevant of the body type. As the issue has been logged for investigation by development team, we’ll let you know as soon as there is some update in this regard.

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

This message was posted using Notification2Forum from Downloads module by Aspose Notifier.


version works great.


Hi Martin,

Thank you for the feedback and please let us know if we can be of any additional help to you in any query related to Aspose.Email.

Have a nice day!