From, Reply-To, Sender and Return-Path are common email headers in email message. You should always set From property at first, it is a MUST to identify the email sender. The following table lists the header and corresponding properties:
Header | Property |
From | SmtpMail.From |
Reply-To | SmtpMail.ReplyTo |
Sender | SmtpMail.Sender |
Return-Path | SmtpMail.ReturnPath |
From
This property indicates the original email sender. This is what you see as the "FROM" in most mail clients.
Reply-To
This property indicates the reply address. Basically, when the user clicks "reply" in mail client, the Reply-To value should be used as the recpient address of the replied email. If you don't set this property, the Reply address is same as From address.
Sender
This property indicates the who submit/send the email. When the user received the email, the email client displays:
From: "sender address" on behalf of "from address".
If you don't set this property, the Sender address is same as From address. Sender property is common used by mail listing provider.
This property also takes effect to DKIM/DomainKeys signature,
if Sender is different with From address, then you should sign DKIM/DomainKeys based on Sender domain instead of From address domain.
Return-Path
This property indicates the delivery notification report address. If you don't set this property, the Return-Path address is same as From address. This property also takes effect to SPF record, if Return-Path is different with From address, then remote SMTP server checkes SPF record of Return-Path instead of From address.
Example
[C# - From, ReplyTo, Sender and Return-Path] SmtpMail oMail = new SmtpMail("TryIt"); oMail.From = new MailAddress("from@adminsystem.com"); oMail.ReplyTo = new MailAddress("reply@adminsystem.com"); oMail.Sender = new MailAddress("sender@emailarchitect.net"); oMail.ReturnPath = new MailAddress("report@emailarchitect.net"); [VB - From, ReplyTo, Sender and Return-Path] Dim oMail As New SmtpMail("TryIt") oMail.From = New MailAddress("from@adminsystem.com") oMail.ReplyTo = New MailAddress("reply@adminsystem.com") oMail.Sender = New MailAddress("sender@emailarchitect.net") oMail.ReturnPath = New MailAddress("report@emailarchitect.net") [JavaScript - From, ReplyTo, Sender and Return-Path] var oMail = new EASendMail.SmtpMail("TryIt"); oMail.from = new EASendMail.MailAddress("from@adminsystem.com"); oMail.replyTo = new EASendMail.MailAddress("reply@adminsystem.com"); oMail.sender = new EASendMail.MailAddress("sender@emailarchitect.net"); oMail.returnPath = new EASendMail.MailAddress("report@emailarchitect.net");
With above example codes:
See Also
SmtpMail.From
SmtpMail.ReplyTo
SmtpMail.Sender
SmtpMail.ReturnPath