locked
[E2010][EWSMA][C#][Windows]: EmailMessage.ToRecipients EmailAddress.Address vs Id RRS feed

  • Question

  • I'm using the EWS Managed API 2.0 with Exchange 2007, 2010, and 2013 to access email messages sent or received using OWA or Outlook 2003, 2007, or 2010. 

    I'm wondering about the format of the EmailMessage.ToRecipients field. It looks like either the EmailAddress.Address or the EmailAddress.Id field can be populated.

    I tried sending an email to a Contact in Outlook 2007 with Exchange 2010, then accessing the email from the Sent Items folder with EWS. The EmailAddress.Address field was populated but not the EmailAddress.Id field. I thought it might be the other way around, since I'd sent the email to a Contact.

    Do you know if there's a scenario with the versions of Outlook and Exchange I'm using where EWS would populate the Id field rather then the Address field, or can I count on the Address field to be populated when I'm accessing email messages that have already been sent or received?

    Thanks in advance,
    Amy

    Monday, January 28, 2013 12:56 PM

All replies

  • You should always see the address (either the X500 or SMTP Address) because Exchange needs to resolves the ID to an address for it to route the message. Outlook has no bearing on what EWS will do. You may want to look at some of the email objects in Mapi Editor so you can look at the Recipients collection on the Message (where you should find both the address and EntryId).

    Cheers
    Glen

    Tuesday, January 29, 2013 6:27 AM