We are having an issue with msg files that have PR_INTERNET_CPID set to 50949.
This throws an exception that 50949 is an invalid windows codepage:
MailMessage mailMessage= mapiMessage.ToMailMessage(new MailConversionOptions());
This codepage is Korean auto-detect. CODEPAGEID | Microsoft Learn
If we open the msg in outlook and use outlookspy to change PR_INTERNET_CPID to 51949 (EUC Korean)… it works.
We need to do this programmatically and I’m not having success.
After opening the mapiMessage we do the following:
if (mapiMessage.Properties[MapiPropertyTag.PR_INTERNET_CPID].GetLong() == 50949)
{
// CP_KAUTODETECT - 50949 - Indicates Korean auto-detect (50949).
// force this to
// 51949 - euc-kr - EUC Korean
mapiMessage.Properties.Remove(MapiPropertyTag.PR_INTERNET_CPID);
mapiMessage.SetProperty(new MapiProperty(MapiPropertyTag.PR_INTERNET_CPID, BitConverter.GetBytes(51949)));
}
Which seems to execute fine… however this is still throwing the same invalid codepage “50949”.
MailMessage mailMessage= mapiMessage.ToMailMessage(new MailConversionOptions());
Can you tell us what we are doing wrong?