3rd party outlook add-on (developer support) RRS feed

  • Question

  • We have developed an  outlook plugin in C# that uses vsto technology. The purpose of this plugin is that outlook users can tag or copy an outlook email onto our platform.  Users simply click on the add on, sign in to it with their credentials (on our system), and finally select an email in outlook and associate it with our system. The message will then be displayed on our portal.

    When emails are sent internally, the email addresses are in x500 format such as "/o=ExchangeLabs/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=

    If the outlook is 32-bit, we can use MAPI to extract the sender email address based on the x500 string. However, if the outlook is 64-bit, the MAPi does not work.

    Question: Given an email object from outlook 64-bit and the sender's email address obtained from the email object is in x500 format, how can we use MAPI to extract the sender's email address from this x500 format?

    We get the object names such as From, To, etc. directly from outlook using our plugin.



    Tuesday, June 30, 2020 4:58 PM

All replies

  • MAPI works just fine in 64 bit.

    But you don't need MAPI to extract a an SMTP address - for a given AddressEntry object (e.g. returned from MailItem.Sender or Recipient.AddresEntry), check the value of the AddressEntry.Type property- if it is anything but "EX", just use the AddressEntry.Address property. Otherwise, use AddressEntry.GetExchangeuser().PrimarySMTPAddress (be prepared to handle nulls and exceptions).

    Dmitry Streblechenko (MVP)
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Tuesday, June 30, 2020 5:41 PM
  • Hello Bobby,

    As Dmitry wrote, there is no need to use MAPI for that until you need to support older Outlook versions (2010 and earlier).

    See HowTo: Convert Exchange-based email address into SMTP email address for the sample code.

    profile for Eugene Astafiev at Stack Overflow, Q&A for professional and enthusiast programmers

    Tuesday, June 30, 2020 7:31 PM