JoseOH2
  • JoseOH2
  • 51.5% (Neutral)
  • Newbie Topic Starter
3 years ago
I'm required to use .MSG extension as my organization's previous developments are not compatible with .EML files.

I've been trying to save mails by using SaveAsOMSG method, however I can't get past the following error message:

"No data is available for encoding 1252. For information on defining a custom encoding, see the documentation for the Encoding.RegisterProvider method."

Does anybody know how to achieve it?

Thanks in advance.
ivan
  • ivan
  • 100% (Exalted)
  • Administration
3 years ago
It seems that you're using .NET Core:
You need to install the package from nuget,
Install-Package System.Text.Encoding.CodePages -Version 5.0.0

Then add the following code before you parse the email.

Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);

EXPLORE TUTORIALS

© All Rights Reserved, AIFEI Software Limited & AdminSystem Software Limited.