Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do we get an Outlook Recipient's actual email address?

Tags:

email

outlook

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.

like image 978
Finn Avatar asked Oct 20 '25 09:10

Finn


1 Answers

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.

like image 188
Dmitry Streblechenko Avatar answered Oct 22 '25 00:10

Dmitry Streblechenko



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!