Search code examples
c#outlook-addinextensibilitycomaddinshared-addin

Detecting BCC in outlook inbox and other folders


I am creating outlook addins using Com addins C# and .net 2.0. I have created Add-in which detects BCC for the Emails present in Inbox etc.

This Add-in actually detects if the email id which is configured in outlook is not present in the TO, CC and prompts that your BCC’ed to this email. But I have recently encountered a problem when two accounts are setup in outlook. I am not able to determine BCC’ed as

  1. If only one account’s email is present in email the add-in says your BCC’ed to this email.
  2. If both accounts email id is present it doesn’t prompts

I want to detect for which account email was sent and prompt for BCC accordingly.

[Important:Actually i am detecting BCC when ReplyToAll button is clicked .]

Any better approach for these issues please any suggestion will be appreciated.


Solution

  • I don't think this can ever be 100% reliable. It an email is auto forwarded, you may or may not get a header added.

    In this particular case, you need to at least loop through all accounts (Namespace.,Accounts) and check the Account.SmtpAddress property. In case of Exchange, you will also need to retrieve the PR_EMS_AB_PROXY_ADDRESSES property to check all SMTP addresses in that list.