Currently sending emails and setting the Return-path of an email(System.Net.Mail) works if i put :

MailMessage msg = new MailMessage();
msg.Sender = new MailAddress("");
msg.Headers.Add("Return-Path", sReturnPath);

but if I send a successful email it would say delivered on behalf of the email above....

any ideas how to resolve this not to put 'on behalf of' but if it bounces back should return to 'not-delivered'?


If I understand correctly, I would do it like this:

static void Main(string[] args)
         SmtpClient smtp = new SmtpClient(_strSomeSmtpAddress);
         MailMessage msg = new MailMessage("", "")
            Subject = "Your Christmas Wish",
            Body = "1. SSP Racer Car with T-Stick",
            ReplyTo = new MailAddress("", "Santa Klaus")


...using an Exchange Server, this does not give any warnings or notices.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.