Domanda

I have set up a microsoft exchange web service to allow me to send and receive data to and from my Microsoft Outlook account.

I am attempting to get the saved Contacts information under my profile and then display this information in a similar format as the Microsoft Outlook 2013 desktop application on a web page.

Unfortunately, I have noticed, any email I have allowed Outlook to auto complete for me (ie recognising the email address I have started typing is in my address book and I press enter to select the suggested email), the string value I get back on my web page is what seems to be the folder root url rather than the email value itself.

ie. "/o=ParentFolder/ou=Group1/cn=Recipients/cn=address1" as opposed to "address1@email.co.uk"

My question is, is there a way to always return the actual email value back regardless of whether the auto complete feature is used or is there another function I can use that allows me to send the root value down and it fetches the corresponding email string?

thanks

È stato utile?

Soluzione

This is the actual email address of type "EX" (as opposed to "SMTP"). Did you add a GAL user to the Contacts folder? You will need the Email1OriginalDisplayName property (DASL name http://schemas.microsoft.com/mapi/id/{00062004-0000-0000-C000-000000000046}/8084001F). You should be able to retrieve it using EWS. Take a look at the contact with OutlookSpy (I am its author) - click IMessage button.

Altri suggerimenti

After spending a day trying to retrieve Email1OriginalDisplayName using pretty much all described methods with no success I tried this approach and it has worked. So I feel it is worth clarifying it some more by including a vb.net code snippet that did it for me.

Dim PropAccessor As Microsoft.Office.Interop.Outlook.PropertyAccessor = oContact.PropertyAccessor
SMTPaddr = PropAccessor.GetProperty("http://schemas.microsoft.com/mapi/id/{00062004-0000-0000-C000-000000000046}/8084001F")

where oContact is an outlook.contactItem and SMTPaddr is a string.

It took me 5 hours of research to get to this answer - this is the only one that really works.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top