使用EWS托管API将电子邮件保存到.MSG文件 [英] Saving an email to a .MSG file using EWS Managed API

查看:95
本文介绍了使用EWS托管API将电子邮件保存到.MSG文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我当前的项目在基于Microsoft Exchange 2010的电子邮件地址上运行服务,该服务专用于将自定义规则应用于传入电子邮件.

My current project runs a service on a Microsoft Exchange 2010-based email address, dedicated to apply custom rules to incoming emails.

当我浏览可能的基于C#的解决方案时,EWS托管API似乎是最适合我使用的API.找到了我需要执行的每一项电子邮件操作,但其中却有一个极其重大的错误...将电子邮件保存到 .msg 文件中.鉴于从Outlook进行操作如此简单(只需将其从Outlook拖放到任何文件夹中),这让我感到非常惊讶.

As I am browsing through the possible C#-based solutions, EWS managed API seems like the best API to use for me. Every email action I need was found, but there is one extremely big one missing... Saving an email to a .msg file. Which is quite surprising to me given how easy of an action it is from Outlook (simply drag and drop from Outlook to any folder).

这是绝对的要求,因为用户可以通过拖放来保持电子邮件的井井有条.EWS有什么我想念的方式吗?到目前为止,我只发现了两种非EWS方式:

This is an absolute requirement as users keep their emails organized through drag and drop. Is there any way I've missed to do that with EWS? So far I've only found two non-EWS ways :

  • 使用不确定我能否负担得起(IndependentSoft) 的第三方库
  • 通过 MessageSave 和Outlook规则使用更复杂的方法来执行自定义操作(该操作为运行MessageSave")
  • Using a third-party library which I am not sure we can afford (IndependentSoft)
  • Using a more complex method with MessageSave and outlook rules to execute a custom action (action being "run MessageSave" )

我很惊讶这样的基本操作需要大量的工作,并且想知道,是否有任何简单的方法可以将电子邮件保存到 .msg 文件中?

I am quite surprised that such a basic action requires so much work and would like to know, is there any easy way to save an email to a .msg file ?

最坏的情况是,有没有基于C#的非EWS API呢?

Worst case scenario, is there a non-EWS API, C# based method to do so?

谢谢

我已经探索了 .eml 导出解决方案.问题是我们使用不支持eml格式的Outlook 2007. .msg 几乎是这里的要求

I have explored the .eml export solution. The issue is we use Outlook 2007, which does not support eml format. .msg is pretty much the requirement here

推荐答案

.msg是仅Outlook本身使用的格式,而不是您正在与之通信的交换服务器使用的格式.

.msg is a format, which only outlook itself uses, not the exchange server you are communicating with.

为此,可以很容易地创建一个.eml文件.

For that matter, a .eml file can be created quite easily.

有关如何操作的信息,请参见此处.

See here, how you can do it.

这篇关于使用EWS托管API将电子邮件保存到.MSG文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆