0 votes

We would like to get NDRs to a specific E-Mail Address (which is different from the FROM Address).

How do I set this address. As I understand, it is not possible to do that using the MailBuilder. Is there a command on the Smtp client?

by

1 Answer

0 votes
 
Best answer

You can always set SMTP FROM manually:

IMail email = Limilabs.Mail.Fluent.Mail.Html("Body")
    .Subject("Subject")
    .From("mailheaderfrom@example.net")
    .To("bob@example.org")
    .Create();

SmtpMail smtpMail = SmtpMail.CreateFrom(email);
smtpMail.From = "smtpfrom@example.com";

using (Smtp smtp = new Smtp())
{
    smtp.ConnectSSL("smtp.example.net");
    smtp.UseBestLogin("smtpuser", "password");
    smtp.SendMessage(smtpMail);
    smtp.Close();
}

Please note that your SMTP server might not like that MAIL FROM, From header and SMTP user are different.

As a side note, do you know VERP:
https://www.limilabs.com/blog/verp-variable-envelope-return-path-net

by (301k points)
...