Need the original email address the email was directed to using EWS Managed API 1.2.1 RRS feed

  • Question

  • Hi,

    I am building an Azure service which monitors an email account for incoming messages from one or more known senders. However each sender can send an email to one or more aliased email addresses on the monitored account.

    This is dictated by 3rd party systems so not much I can do about.

    What I need is being able to get the original email address to which the email was sent to, the reason is that the email contains process specific instructions.

    What I found in the API is that I can get the receiving account but this only shows the main account address and not the alias address the 3rd party send the email to.

    Is there a way to get that info or is this an Exchange Server problem rather than an API issue?

    Any suggestions are welcome.


    Sunday, July 15, 2012 3:02 AM

All replies

  • Its not a server problem or an API issue what happens in the Transport Pipeline is the Address will be resolved to the primary SMTP address of the Mailbox which is what you see in EWS (or Mapi/Outlook). What you can do is use PR_TRANSPORT_MESSAGE_HEADERS to get the original MIME To: header see for a sample


    Monday, July 16, 2012 7:47 AM
  • Hi Glen,

    I tried that solution but didn't get anywhere, I noticed that sending an email within Exchange is different than sending an email from outside of Exchange.

    I resorted to running through the InternetMessageHeaders and search for the "for <...>" string using regex. This works fine as long as the email originates from a different email server which is guaranteed in my scenario. So I am covered.

    But I would request to just have this Receiver.AliasAddress being available in the API just like Sender.Address address is.


    Monday, July 16, 2012 9:35 AM