Exchange Transport Agent Bounce MailItem

289 views Asked by At

In our Exchange RoutingAgent, we would like to be able to bounce an email back to the sender in the event of an unexpected exception. We would also like to be able to send the bounce message to some pre-defined admin email too if possible. Is there any way to bounce a message in the OnSubmittedMessage or the OnResolvedMessage events? I am hoping there is some method in the Exchange libraries to easily achieve this, or is there some way to create a new MailItem and send it to the original sender and possibly an admin?

1

There are 1 answers

2
Glen Scales On BEST ANSWER

You need to generate a new message to do that there is a sample for this on https://blogs.msdn.microsoft.com/mstehle/2010/03/10/howto-return-to-sender-transport-agent-sample/

You should also be able to use https://msdn.microsoft.com/en-us/library/jj976002(v=exchg.150).aspx

Cheers Glen