none
Get SMTP Email address in Contact Item Using EWS managed API. RRS feed

  • Question

  • I use EWS Managed API. And I want get email address in Contact Item.

    txtEmail.InnerText = contact.EmailAddresses[EmailAddressKey.EmailAddress1].Address;

    But i can't get SMTP emiladdress. they return only path like this.

    "/o=First Organization/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=A09103984"

    how can i can SMPT email address?

     

    Sunday, July 4, 2010 9:01 AM

Answers

  • This means that the email address being stored in that property is the EX type if the contact has been added from the GAL (or migrated from somewhere) if you use a Mapi editor you will probably find the SMTP address is in another property but the way i would tackle this is you can use the EX address and the EWS resolvename operation to get the SMTP Address eg

            NameResolutionCollection nd = service.ResolveName(contact.EmailAddresses[EmailAddressKey.EmailAddress1].Address);
            foreach (NameResolution nm in nd) {
              if (nm.Mailbox.RoutingType == "SMTP")
              {
                Console.WriteLine(nm.Mailbox.Address);
              }
            }

    Cheers
    Glen

    • Marked as answer by Tai Jun Lee Tuesday, July 6, 2010 12:42 PM
    Tuesday, July 6, 2010 7:20 AM