简体   繁体   English

如何在Outlook VSTO加载项中导入.eml

[英]How to Import .eml in Outlook VSTO AddIn

How can i import .eml files into Outlook Native Emails So i may store them as local storage. 我如何将.eml文件导入Outlook本机电子邮件中,所以我可以将它们存储为本地存储。 I have .eml files which need to be properly parsed and imported into Outlook Native Emails. 我有.eml文件,需要正确解析并将其导入到Outlook Native Emails中。

You can do that using Redemption Import Feature . 您可以使用“ 兑换导入功能”来实现

var inbox = RDOSession.GetDefaultFolder(rdoDefaultFolders.olFolderInbox);
RDOMail mailitem = inbox.Items.Add();
mailitem.Import(@"e:\\test.eml", RedemptionSaveAsType.olRFC822);
mailitem.Save();

What this code does is gets the default Inbox folder and creates a empty email item. 该代码的作用是获取默认的“收件箱”文件夹并创建一个空的电子邮件项目。 Then the import function retrieves the .eml file and parses into the email. 然后,导入功能检索.eml文件并将其解析为电子邮件。 we can save this to inbox then. 我们可以将其保存到收件箱中。

If we are using any Webservices then by fetching the .eml with HttpClient and then import and save it. 如果我们正在使用任何Web服务,则通过使用HttpClient提取.eml,然后导入并保存它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM