Comments on: Send email with custom header https://www.limilabs.com/blog/send-email-with-custom-header Using Limilabs .net components Mon, 12 Jan 2015 23:52:44 +0000 hourly 1 https://wordpress.org/?v=6.6.2 By: Limilabs support https://www.limilabs.com/blog/send-email-with-custom-header#comment-141049 Tue, 23 Oct 2012 08:47:54 +0000 http://www.limilabs.com/blog/?p=1289#comment-141049 In reply to Petr.

@Petr

builder.AddCustomHeader(
    "Return-Path", "<wikipedians-owner+bob=example.org@example.net>");

Please note that SMTP server may remove or modify it, replacing it with the value specified in the SMTP ‘MAIL FROM’ command.

You can use build-in Variable Envelope Return Path support, or you can specify ‘MAIL FROM’ address directly:

IMail email = ...

SmtpMail smtpMail = new SmtpMail(
    "wikipedians-owner+bob=example.org@example.net", // MAIL FROM
    new [] { "bob@example.org"}, // RCPT TO
    email.RenderEml()); // DATA

using (Smtp smtp = new Smtp())
{
    smtp.Connect("smtp.example.net");
    smtp.UseBestLogin("user", "pass");
    smtp.SendMessage(smtpMail);
    smtp.Close();
}
]]>
By: Petr https://www.limilabs.com/blog/send-email-with-custom-header#comment-138503 Mon, 22 Oct 2012 20:21:33 +0000 http://www.limilabs.com/blog/?p=1289#comment-138503 How could I include “return-path” header into email message?

]]>