EWS Body of Email回来了吗?

时间:2012-04-12 17:20:03

标签: exchangewebservices outlook-redemption

我们正在转换处理我们发送的退回电子邮件的批处理作业。我们正在从Redemption切换到EWS(刚刚从Exchange 2003升级到Exchange 2010)。如您所知,退回的电子邮件有不同的形式。我已经能够完成我所有的测试用例电子邮件,除了以下形式的电子邮件:

Your message did not reach some or all of the intended recipients.


      Subject: Hello
      Sent: 4/01/2012 8:16 AM

The following recipient(s) cannot be reached:

      hi@foo.com on 4/01/2012 8:19 AM
            The e-mail system was unable to deliver the message, but did not report a specific reason.  Check the address and try again.  If it still fails, contact your system administrator.
             smtp.mydomain.com #5.0.0 smtp; 5.3.0 - Other mail system problem 554-"delivery error: dd This user doesn't have a foo.com account (hi@foo.com) [-5] - mail.foo.com" (delivery attempts: 0)>

这是outlook中显示的内容。当我用EWS阅读电子邮件时,Body是空的。当我收到EWS的电子邮件时,我需要查看上面的信息。电子邮件有一个附件(这是原始电子邮件)虽然它在Outlook中看起来不那样。我试图查看从EWS返回的几乎所有属性,但仍然能够找到上面的文本。 Redemption允许您使用ReportText查看此信息。我们特别寻找的是电子邮件错误传递代码。我们根据此代码做了不同的事情。

编辑:为了更清楚,我的其他测试用例的Body属性不是空的。我正在加载电子邮件,如:

            Dim emailPset = New PropertySet(BasePropertySet.FirstClassProperties)
            emailPset.RequestedBodyType = BodyType.Text
            Dim f = EmailMessage.Bind(email.Service, email.Id, emailPset)

Update1:​​经过一些研究后,看起来我需要能够在PR_NDR_STATUS_CODE&中读取消息的Recipients表。 PR_REPORT_TEXT字段。仍在搜索是否有办法在EWS中执行此操作。

1 个答案:

答案 0 :(得分:0)

我们能够获得足够的信息

smtp.mydomain.com #5.0.0 smtp; 5.3.0 - Other mail system problem 554-"delivery error: dd This user doesn't have a foo.com account (hi@foo.com) [-5] - mail.foo.com" (delivery attempts: 0)>

部分是告诉对象加载MIME内容所需的部分。

绝对不是最直接使用的API,但希望我们不再打击更多。