0 votes
by (150 points)
edited

Hello,

I understand that if I need to have the Return-Path set (where the emails will bounce), I need to set the Sender address. But setting the Sender address shows "on behalf of" in Outlook. I want to avoid that and just sent the Return-Path in the header without setting the Sender property. Is it possible in Rebex' email components?

Thanks, Sudhakar

Applies to: Rebex Secure Mail

1 Answer

0 votes
by (58.9k points)
edited
 
Best answer

Hello

it is possible. You have to manually specify the sender in the Smtp's Send(mail, sender, recipients) method, not in the message.

The Return-Path is added to the message by the recipient's SMTP server.

Please try this code:

        MailMessage mail = new MailMessage();
        mail.Subject = "...";
        mail.BodyText = "...";
        mail.From = "..."; //real sender
        mail.To = "...";
        ...
        Smtp smtp = new Smtp();
        smtp.Connect("server", port);
            ...
        smtp.Send(mail, "sender - return path", null); //address for bouncing

Does it work for you?

by (150 points)
edited

Yes, it works! Thanks so much.

Sudhakar.

...