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

Free Support Forum - aspose.com

Code-page-Problem converting msg-file to html / tiff

Hi,

I try to convert a .msg-file to html (and later on to tiff), and I have problems converting äüö…
How can I control that?
This is my code:
Aspose.Email.Mail.MailMessage mail;
mail = MailMessage.Load(sInFile);
Aspose.Email.Mail.HtmlSaveOptions options = Aspose.Email.Mail.SaveOptions.DefaultHtml;
options.EmbedResources = false;
options.HtmlFormatOptions = HtmlFormatOptions.WriteCompleteEmailAddress;
mail.Save(sOutFile + “.html”, options);

Kind regards,
Oliver

Hi Oliver,


Please try specifying the UTF8 encoding as follow:

MailMessage msg = MailMessage.Load(“input.msg”, new MsgLoadOptions { PrefferedTextEncoding = Encoding.UTF8 });

If the issue persists, please share your sample MSG file with us for further investigation at our hand.

Hi,
thanks for your help.
I finally got it this way:
MsgLoadOptions mOpts = new MsgLoadOptions();
mOpts.PrefferedTextEncoding = Encoding.Unicode;
mail = MailMessage.Load(sInFile, mOpts);

and when reading the html-file for tiff-conversion:

            Aspose.Words.LoadOptions lo = new Aspose.Words.LoadOptions();
            lo.LoadFormat = Aspose.Words.LoadFormat.Mhtml;
            lo.Encoding = Encoding.UTF8;

            Aspose.Words.Document doc = new Aspose.Words.Document(sInStream, lo);

Looks like it works now.

Kind regards,
Oliver

Hi Oliver,


It’s good to know that the suggested code sample helped you in achieving your desired results. Please feel free to write to us if you have any further query in this regard.