Buonce email

Jan 7, 2014 at 4:42 PM
is it possible to set the reverse-path of an outgoing smtp email, so that bounce messages will be delivered to a bounce mailbox different from the email sender?

Jan 7, 2014 at 11:07 PM
You can add your original header value by
SmtpMessage mg = new SmtpMessage();
mg.Header.Add(new InternetTextMessage.Field("Reverse-Path", "your value"));
Jan 8, 2014 at 8:54 AM
But, if I set the reverse-path on the header, is there any way to also change the "MAIL FROM" parameter? If the library will contact the recipient SMTP server to delivery the email, I think that is mandatory to change to MAIL FROM parameter to manage bounce emails. Is this right? Or the reverse-path is sufficient?

Jan 9, 2014 at 12:05 AM
You can set mail from parameter by
SmtpMessage mg = new SmtpMessage();
mg["Reverse-Path"] = "<reverthpath@gmail.com>";
mg.From = new MailAddress("xxx@gmail.com");
This settings change raw text of mail like
From: <xxx@gmail.com>
Reverse-Path: <reverthpath@gmail.com>
MIME-Version: 1.0
Date: Wed, 8 Jan 2014 16:23:50 +0900
...other headers...
You can also set mail from parameter that actual send to smtp server by using SendMailCommand class.
You can set defferent value to MailFrom by using SmtpMessage and SmtpMailCommand if you want to.
SmtpMessage mg = new SmtpMessage();
mg.From = new MailAddress("xxx@gmail.com");
SmtpMailCommand cm = new SmtpMailCommand("yyy@gmail.com", mg);
To learn about SMTP protocol, you can see this article.