The Mailbox
element has child elements named Sender
and From
. And I'm really confused about the difference between them.
This is what the documentation says about Sender
:
The Sender element specifies the e-mail address of the person who sent an item
And about From
:
The From element represents the address from which the message was sent
Really, it doesn't make any difference for me. The XML that I see is always the same for the both elements. So what is the real difference between these two?
In plain English:
From
is who the message is from. It is who the recipient's email client should display the message is from.
Sender
is usually the same as From
, unless the message was originated by somebody, or some other system than the actual From
address.
Example: Gmail when it's configured for a domain not hosted by Gmail. The From
would contain you@yourdomain.com, but the Sender
will contain someone@gmail.com. Many mail clients will render this as someone@gmail.com on behalf of you@yourdomain.com.
From Official RFC - Registration of Mail and MIME Header Fields
2.1.2. Header Field: From Description: Mailbox of message author [...] Related information: Specifies the author(s) of the message; that is, the mailbox(es) of the person(s) or system(s) responsible for the writing of the message. Defined as standard by RFC 822. 2.1.3. Header Field: Sender Description: Mailbox of message sender [...] Related information: Specifies the mailbox of the agent responsible for the actual transmission of the message. Defined as standard by RFC 822.