I am sending emails to clients in three different locations, using a common email address. Any errors/ out of office replies should go to local offices for them to deal with. So I use:
from: common@abc.com
reply-to: london@abc.com
from: common@abc.com
reply-to: newyork@abc.com
from: common@abc.com
reply-to: tokyo@abc.com
This seems to work well for email fails (wrong adddress, etc.) but Out of Office replies from Exchange always go to the sender address, common@abc.com. I need them to go to the local office, reply-to address.
Any idea how I can solve this? I am sending the email from c#, using the standard MailMessage:
MailMessage mail = new
mail.Subject = mailDetail["subject"].ToString();
mail.Body = mailDetail["body"].ToString();
// From
mail.From = new MailAddress(ConfigManager.GetSetting("MailSender"));
// Reply to (boucebacks / out of office etc)
mail.ReplyTo = new MailAddress(mailDetail["reply_to"].ToString());
mail.DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure;
Thanks for any help,
Ryan
It’s up to anyone/thing that responds to the mail to choose which property is most appropriate to use. The
reply-toproperty should of course be used if it’s a real reply, but an error message might not be seen as a reply, so thefromproperty may be used for that in some cases. As you see, you will get different results depending on who/what is answering, and why.You can use the
Senderproperty to specify the actual sender as an addition to thefromproperty. If it’s handled properly, that is where the error messages should go if thereply-toproperty isn’t used.