none
Using EWS & Body of email is an empty string? RRS feed

  • Question

  • We are in the process of converting a batch job that processes our bounced emails that we send. We are switching from Redemption to EWS (just upgraded to Exchange 2010 from Exchange 2003). As you know bounced emails come in different forms. I have been able to work through all the test case emails i've got except for the ones that come in the form of:

    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)>

    This is what is displayed in outlook. When i read the email with EWS the Body is empty. I need to look at the information above when i get the email with EWS. The emails have an attachment (which is the original email) though it doesn't look that way in outlook. I've tried to look at almost all the properties that comes back from EWS and have yet been able to find the text above. Redemption allow you to look at this info using ReportText. What we are specifically trying to get at is the Email Error Delivery code. We do different things based upon this code.

    Edit: To be clearer the "Body" Property in my other test cases isn't empty. Here is how i'm loading the emails.

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

     Update: After some research it looks like i need to be able to read the Recipients table of the message in the PR_NDR_STATUS_CODE & PR_REPORT_TEXT fields. Still searching if there is a way to do this in EWS.




    • Edited by Choclabs74 Thursday, April 12, 2012 7:19 PM
    Thursday, April 12, 2012 5:14 PM