4

Hoping to get a little help with this one that has stumped me today:

Outlook.MailItem mail = (Outlook.MailItem)Item;
Outlook.Recipients recips = mail.Recipients;
string toField = recips[1].Address; 

I'm not getting the actual address returned. I've tried suggestions on the MSDN site with no luck. Specifically, the PR_SMTP_ADDRESS service is dead:

Const PR_SMTP_ADDRESS As String = _ 
    "http://schemas.microsoft.com/mapi/proptag/0x39FE001E"  

Thanks very much in advance for any help you all can provide.

Finn
  • 43
  • 1
  • 3

1 Answers1

5

Use Recipient.AddressEntry to get the AddressEntry object. Check if the AddressEntry.Type property, if it is SMTP, just use AddressEntry.Address. If it is EX, use AddressEntry.GetExchangeUser.PrimarySmtpAddress.

Max
  • 429
  • 1
  • 8
  • 25
Dmitry Streblechenko
  • 62,942
  • 4
  • 53
  • 78
  • Be sure to handle errors correctly - Recipient.AddressEntry will return null for unresolved recipients or raise an error if the address entry cannot be opened. – Dmitry Streblechenko Oct 22 '14 at 17:16