Hi team,
We have 2 options (SaveOptions.DefaultMsg and SaveOptions.DefaultMsgUnicode) in case of saving message to file in .msg format. If we use MapiMessage we can get MessageFormat. But MailMessage doesn’t have property like MessageFormat. Look at the code below please:
MsgLoadOptions emlLoadOptions = new MsgLoadOptions(); MailMessage eml = MailMessage.Load(emailFile, emlLoadOptions); MapiMessage msg = MapiMessage.FromFile(emailFile); var tmp = Path.GetFullPath(emailFile).Replace(Path.GetFileName(emailFile), ""); eml.Save(tmp + "EmlDefaultMsg.msg", SaveOptions.DefaultMsg); eml.Save(tmp + "EmlDefaultMsgUnicode.msg", SaveOptions.DefaultMsgUnicode); if (msg.MessageFormat == OutlookMessageFormat.ASCII) msg.Save(tmp + "MsgDefaultMsg.msg", SaveOptions.DefaultMsg); else msg.Save(tmp + "MsgUnicodeMsg.msg", SaveOptions.DefaultMsgUnicode);
The question is how we should understand which options (SaveOptions.DefaultMsg or SaveOptions.DefaultMsgUnicode) we should use in case of MailMessage?
Thanks.
Dmitry