none
Recipient.Resolve() - Always Returns true RRS feed

  • Question

  • As an Experiment, I sent an email to the following users

    User A - (Exchange user)
    User B - (Yahoo email)
    User C - (Exchange user)
    User D - (Gmail user)

    When I iterated through the Recipients collection and called the "Resolve" method for each Recipient object in the collection, I found that each call returned "True".  I can see that being the case for the Exchange Users, however I don't see how the Yahoo, and Gmail users could be resolved successfully if they don't appear in the Address Book.

    Any guesses here?


    • Edited by GermanEZI Monday, May 2, 2016 6:50 PM clarification
    Monday, May 2, 2016 6:49 PM

Answers

  • If you provide an SMTP address, Outlook creates a one-of entry id that contains the email address and display name.

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    • Marked as answer by GermanEZI Monday, May 2, 2016 7:28 PM
    Monday, May 2, 2016 7:22 PM

All replies

  • If you provide an SMTP address, Outlook creates a one-of entry id that contains the email address and display name.

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    • Marked as answer by GermanEZI Monday, May 2, 2016 7:28 PM
    Monday, May 2, 2016 7:22 PM
  • Amazing.  Why isn't information like that in the online documentation?  Perhaps there's another place I should be looking?

    I was going to use "Resolve" to determine how many non-Exchange users were on the Recipient list.

    Thanks again Dmitry.  What I'll do then is retrieve the SMTP email address of each recipient and inspect the value.

    Monday, May 2, 2016 7:28 PM
  • Now, I'm curious.  What kind of Recipient would cause the return value of Recipient.Resolve() to be false?
    Monday, May 2, 2016 7:29 PM
  • You can simply check the Recipient.AddressEntry.Type property (EX vs SMTP). Or you can retrieve the PR_ADDRTYPE property (DASL name http://schemas.microsoft.com/mapi/proptag/0x3002001F) using Recipient.PropertyAccessor.GetProperty

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Monday, May 2, 2016 7:41 PM
  • It will fail if you pass a display name (e.g. "Joe The User") and it cannot be resolved using any address book provider in Outlook.

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Monday, May 2, 2016 7:42 PM
  • I was retrieving the SMTP Address of each recipient, but your method is far less error prone.

    Retrieving the address was fine, but then I had to do a case insensitive string comparison to our company domain name.  Not so great.

    Thanks again!

    Monday, May 2, 2016 8:50 PM