cagi
cagi

Reputation: 239

vsto outlook get account email address which received email

Consider this situation: in my outlook I have two accounts [email protected] (default) and [email protected] . If someone sends one e-mail message to booth my addresses I’ll end up with two email in my outlook inbox. Is it possible (using VSTO for Outlook) to differentiate which email message was received for gmail.com domain and which for yahoo.com? I have this

String emailAddress = Globals.ThisAddIn.Application.Session.CurrentUser.Address;

but it's always [email protected]. If I iterate Outlook.MailItem.Recipients I’ll get booth my email address and can’t resolve which of them is true recipient.

Upvotes: 0

Views: 1282

Answers (1)

Dmitry Streblechenko
Dmitry Streblechenko

Reputation: 66235

Use the MailItem.SendUsingAccount property - it will point to the account used to receive the message.

Upvotes: 3

Related Questions