none
Exchange 2010 SP1 Web Services create contact issue EX vs SMTP RRS feed

  • Question

  • We just had a custom app developed that pulls contact data from our CRM database and uses Exchange Web Services to create contacts in Exchange users contacts folder. The app is working great except all contacts that are also in the Exchange organization are getting their contact type created as 'EX' by EWS instead of 'SMTP'.

    For example, the Exchange server is hosting addresses for the domain @abcd.com, any contact created that has a email address ending in @abcd.com is created with Email Address Type of EX.

    This is causing a big issue as BES will not sync contacts with email address type set to EX to Blackberrys, it only syncs SMTP type.

    Manually creating a contact in Outlook with the @abcd.com domain results in the email address type of SMTP.

    Question: Is there a way through EWS to change the email address type to SMTP? Or is there a setting in Exchange 2010 that is somehow causing the type to be set to EX?

    Here is a snippet of code that is creating the necessary attributes of the contact email address prior to updating or inserting:

    ..

    Microsoft.Exchange.WebServices.Data.Contact contact = Microsoft.Exchange.WebServices.Data.Contact.Bind(exchangeService, itemIdentifier);

     

    ..

     

    Microsoft.Exchange.WebServices.Data.EmailAddress emailAddress = new  Microsoft.Exchange.WebServices.Data.EmailAddress(ContactInformation.Email);

    emailAddress.RoutingType = "SMTP";                                   contact.EmailAddresses[Microsoft.Exchange.WebServices.Data.EmailAddressKey.EmailAddress1] = emailAddress;

    ..

    contact.Update(ConflictResolutionMode.AlwaysOverwrite);

     

    Thanks in advance for any thoughts or input

    Tuesday, April 12, 2011 2:38 PM

All replies

  • Good Morning Rob_Patterson42,

    We are experiencing exactly the same issue and i was wondering if you found any solution to this issue ?

    Thx 

    Thomas

    Monday, May 14, 2012 8:11 AM
  • We are literally in the exact same situation as rob_patterson42.  We're trying to sync over addresses from a CRM app using EWS.  Attempting to write email addresses that are already in the GAL forces a conversion from SMTP to x500 and it's stopping BES from working correctly.  I honestly think it's quite silly EWS does this.  Does anybody know of any way to get around this issue?  
    Monday, August 27, 2012 8:02 PM
  • If you set the Extended properties directly for the Email addresses eg for EmailAddress1

    IID 0x8080 - Email1DisplayName,
    IID 0x8082 - Email address type,
    IID 0x8083 - Email1Address,
    IID 0x8084 - EMail1DisplayName,
    IID 0x8085 - Email1 EntryID (You'll need to generate a OneOffAddress yourself http://msdn.microsoft.com/en-us/library/office/cc842281.asp and )

    that's the only way i know you would be able to override that behaviour (there is nothing wrong the behavoiur itself and its what Exchange and Outlook has always done)

    Cheers
    Glen

    Tuesday, August 28, 2012 3:21 AM