none
Which Properties can you use to retrieve an SMTP Address? RRS feed

  • Question

  • In my code I examine the value of OlAddressEntryUserType to examine an AddressEntry.  

    I'm not sure if all types can be used to retrieve an SMTP Address.  The ones I've marked "?", II haven't encountered in my testing, and I'd like to be prepared.

    Member name

    Description

    olExchangeUserAddressEntry

    ExchangeUser.PrimarySMTPAddress

    olExchangeDistributionListAddressEntry

    ExchangeDistList.PrimarySmtpAddress

    olExchangePublicFolderAddressEntry

    ?

    olExchangeAgentAddressEntry

    ?

    olExchangeOrganizationAddressEntry

    ?

    olExchangeRemoteUserAddressEntry

    ExchangeUser.PrimarySmtpAddress

    olOutlookContactAddressEntry

    if( Email1AddressType == "SMTP") ContactItem.Emai1Address

    olOutlookDistributionListAddressEntry

    ?

    olLdapAddressEntry

    ?

    olSmtpAddressEntry

    AddressEntry.Address

    olOtherAddressEntry

    Possible ?





    • Edited by GermanEZI Wednesday, June 28, 2017 6:30 PM Clarification
    Wednesday, June 28, 2017 6:29 PM

Answers

  • Check if AddressEntry.Type == "EX" - then you can use GetEXchangeUser.PrimarySmtpAddress. Otherwise just use AddressEntry.Address.

    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 Wednesday, June 28, 2017 7:46 PM
    Wednesday, June 28, 2017 7:41 PM

All replies

  • Why do you need to concern yourself with the address entry type? Either GetExchangeUser.PrimarySmtpAddress succeeds, or it doesn't. And if it doesn't work, does it matter why? As an example, a PF folder may o may not have an SMTOP address depending on whether it is mail-enabled.

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

    Wednesday, June 28, 2017 7:10 PM
  • The web service we're using will only accept SMTP address format.  I can't send over something like "/O=My organization /OU=sub unit /CN=nyid"

    If the AddressEntry is an Outlook Contact then GetExchangeUser will return Null.  I need to use GetContact.  However, I can still use the ContactItem.Email1Address to retrieve the smtp address (assuming it's in that form)

    The other AddressEntry types are a mystery to me since I haven't had any accounts come my way that were of those types.
    • Edited by GermanEZI Wednesday, June 28, 2017 7:24 PM clarification
    Wednesday, June 28, 2017 7:24 PM
  • Check if AddressEntry.Type == "EX" - then you can use GetEXchangeUser.PrimarySmtpAddress. Otherwise just use AddressEntry.Address.

    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 Wednesday, June 28, 2017 7:46 PM
    Wednesday, June 28, 2017 7:41 PM
  • Thanks
    Wednesday, June 28, 2017 7:46 PM