I'm trying to extract html body from outlook .msg file using outlook type library and displaying it on Web-browser control in c#. On my development machine it working perfectly fine, however on the client machine, some of the text from the email is being shown as random chinese characters.
Below is the code to extract & show html from email :
using OL=Microsoft.Office.Interop.Outlook;
OL.Application olApp = new OL.Application();
OL.MailItem mail = olApp.Session.OpenSharedItem(txtFile.Text) as OL.MailItem;
webBrowser1.DocumentText = mail.HTMLBody;
On my machine, part of the email is being shown as:
> then the "Click Here" link.
But on client machine, the same text looks like :
> and then the 揅lick Here?link.
What I have tried:
**So far this issue only occurs if there is any double quote in the text** but i cannot confirm if this is only related to double quotes.
I have the same outlook version as that of client machine (Outlook 2016).
I tried disabling the outlook's smart quote feature on the client machine but it didn't make any difference.
I suspect that some language setting may be causing this issue.
I tried using some third party libraries like this one
Reading an Outlook MSG File in C#
but it is also giving incorrect results.
I cannot use redemption library due to costing issues.
Any help or guidance would be very appreciated!!