I have a from rewrite in place which works just fine:
e.MailItem.FromAddress=newRoutingAddress("aa","xx.de"); e.MailItem.Message.From.SmtpAddress="aa"+"@"+"xx.de"; e.MailItem.Message.Sender.SmtpAddress="aa"+"@"+"xx.de"; e.MailItem.Message.From.DisplayName="aa"; e.MailItem.Message.Sender.DisplayName="aa";
The rewrite is registered with OnResolvedMessage.
However, when I use 'send as' - which by itself does work as well - only the envelope-from address (I think it corresponds to e.MailItem.FromAddress) will be changed by the rewrite. But the From address will not be changed.
When I do a logging of e.MailItem.Message.Sender.DisplayName after the rewrite, it will be logged as correctly rewritten (no matter whether I use 'send as' or not). However, any Email which was generated with ‘send as’, that leaves the system will still show the original values (except the correctly rewritten envelope-from address).
Any hint is highly appreciated!
Thanks Jan