I need to set up an automated email system , which means users should
not be able to respond back to the emails but at the same time, we
need to track bounced emails. This is important as our customers are
paying for this service, so we need to track the bounced email Id's.
This is the code which I have tried:-
MailMessage msgRequest = new MailMessage();
msgRequest.Body Format = MailFormat.Text ;
msgRequest.Subj ect = "Do Not reply to this email";
msgRequest.To = "Cu*******@abc. com";
msgRequest.From = "au*******@comp any.com";
msgRequest.Body = "Message Body";
msgRequest.Head ers.Add("Return-Path", "va**********@c ompany.com");
//msgRequest.Head ers.Add("Errors-To", "va**********@c ompany.com");
SmtpMail.SmtpSe rver = "SMTPServerName ";
SmtpMail.Send(m sgRequest);
I have tried both "Return-Path" and "Errors-to". But both of them
falied. The functionality that users cannot reply us back works fine
with this code but this code fails in tracking bounced emails. So for
invalid email id in "To", have no action reported to "return-path" or
"errors-to" valid Email Id.
I have also tried doing this:-
MailMessage msgRequest = new MailMessage();
msgRequest.Body Format = MailFormat.Text ;
msgRequest.Subj ect = "Do Not reply to this email";
msgRequest.To = "Cu*******@abc. com";
msgRequest.From = "va**********@c ompany.com";
msgRequest.Body = "Message Body";
msgRequest.Head ers.Add("From", "au*******@comp any.com");
SmtpMail.SmtpSe rver = "SMTPServerName ";
SmtpMail.Send(m sgRequest);
Using this code, user only sees au*******@compa ny.com and never sees
va**********@co mpany.com so they cannot reply us back. But again this
code fails for tracking bounced emails. It doesnt send me bounced
emails at va**********@co mpany.com.
Can somebody suggest me what is going wrong here?
Quick response will be really appreciated and Thanks in Advance for
any help.