2012-04-12 95 views
0

我们正在转换处理我们发送的退回电子邮件的批处理作业。我们正在从赎回转换为EWS(刚从Exchange 2003升级到Exchange 2010)。正如你所知,反弹的电子邮件有不同的形式。我已经能够通过所有的测试案例电子邮件我有除外进来的形式的那些工作:EWS电子邮件正文返回空?

 
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: 

     [email protected] 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 ([email protected]) [-5] - mail.foo.com" (delivery attempts: 0)> 

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

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

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

UPDATE1:经过一番研究,它看起来像我需要能够读取该邮件的收件人表中PR_NDR_STATUS_CODE & PR_REPORT_TEXT领域。仍在搜索是否有方法在EWS中执行此操作。

回答

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 ([email protected]) [-5] - mail.foo.com" (delivery attempts: 0)> 

一部分是我们所需要的,通过告诉对象加载MIME内容。

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