0

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("not-deliviered@sample.org");
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'?

thanks

2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by thines01
0

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

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

         smtp.Send(msg);
      }

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

Edited by thines01: formatting

This article has been dead for over six months. Start a new discussion instead.
Be sure to adhere to our posting rules.