Save Email as MSG file without using Outlook (COM object, etc.) or 3rd party software

安稳与你 提交于 2019-12-02 05:29:42
Eric Legault

You can still use PowerShell with the Outlook Object Model (OOM), if that's what you are hoping for.

You can also use Redemption, which has more features than OOM (it can also be run in a service, doesn't fire Outlook security prompts, etc.).

You can create an MSG file explicitly in your code (it is an OLE storage (IStorage) file and its format is documented) - parse the EML file, then populate various MAPI properties in the MSG file.

You can also use Redemption. Converting an EML file to MSG is as easy as

  RDOSession Session = new RDOSession();
  RDOMail Msg = Session.CreateMessageFromMsgFile(@"c:\temp\YourMsgFile.msg");
  Msg.Import(@"c:\temp\YourEmlFile.eml", rdoSaveAsType.olRFC822);
  Msg.Save();
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!