How to get the REAL recipient of an e-mail using EWS?

Sándor Tamás 0 Reputation points
2023-12-15T23:27:24.9+00:00

We are looking for a solution to the problem of downloading emails with EWS.

On the exchange server, we use a mailbox with several aliases (e-mail addresses). If we send an e-mail with Outlook (or OWA) to a alias and then try to download the mail via EWS, the email does not contain the real recipient. Also the mime content of the email downloaded via EWS shows the primary email address and not the alias. If we send out mail via SMTP, there is no such problem. Furthermore, when looking at the mime content of an email with OWA, the correct email address is visible.

We have a client who is now moving from lotus notes to exchange and we definitely need this feature to be able to process the incoming emails as it was done earlier.

We hope to have a solution as soon as possible.

Exchange Server
Exchange Server
A family of Microsoft client/server messaging and collaboration software.
1,170 questions
Exchange Server Development
Exchange Server Development
Exchange Server: A family of Microsoft client/server messaging and collaboration software.Development: The process of researching, productizing, and refining new or existing technologies.
525 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Sándor Tamás 0 Reputation points
    2023-12-20T12:31:45.5933333+00:00

    Updates:

    We have managed to extract the recipient using extended properties and loading Internet message headers, but unfortunately this solution doesn't cover all the problems.

    We have noticed that sometimes when we send emails from Outlook to an alias, and if we check the Sent items folder after sending, the recipient of the mail is changed to the primary address. In these cases, no matter how we try to extract the recipient of the incoming mail through EWS it will always contain the primary address. Is there a setting in Outlook or in Exchange Server that affects this? We've already tried the Automatic name checking and Auto complete settings, but without much success. Oddly enough, when using Outlook sometimes it changes the recipient, other times it doesn't. (When using OWA the email address is always replaced)

    So the main question is whether e-mail aliases can be used reliably to distinguish incoming messages, and if so, could you provide guidance on how to do so?