Questions tagged [email-headers]

E-mail headers are the headers at the beginning of an e-mail that define various properties (e.g. `From` or `Reply-To`) of the e-mail.

In an e-mail, the body (content text) is always preceded by header lines that identify particular routing information of the message, including the sender, recipient, date and subject. Some headers are mandatory, such as the FROM, TO and DATE headers. Others are optional, but very commonly used, such as SUBJECT and CC. Other headers include the sending time stamps and the receiving time stamps of all mail transfer agents that have received and sent the message. In other words, any time a message is transferred from one user to another (i.e. when it is sent or forwarded), the message is date/time stamped by a mail transfer agent (MTA) - a computer program or software agent that facilitates the transfer of email message from one computer to another. This date/time stamp, like FROM, TO, and SUBJECT, becomes one of the many headers that precede the body of an email.

Characteristics

A single email header has some important characteristics, including perhaps the most important part of an email - this is the KEY:VALUE pairs contained in the header. Looking at the above, you can tell some of the KEY:VALUE pairs used. Here is a breakdown of the most commonly used and viewed headers, and their values:

  • From: sender's name and email address (IP address here also, but hidden)
  • To: recipient's name and email address
  • Date: sent date/time of the email
  • Subject: whatever text the sender entered in the Subject heading before sending

Routing

Email headers also provide information on the route an email takes as it is transferred from one computer to another. As mentioned earlier, mail transfer agents (MTA) facilitate email transfers. When an email is sent from one computer to another it travels through a MTA. Each time an email is sent or forwarded by the MTA, it is stamped with a date, time and recipient. This is why some emails, if they have had several destinations, may have several RECEIVED headers: there have been multiple recipients since the origination of the email. In a way it is much like the same way the post office would route a letter: every time the letter passes through a post office on its route, or if it is forwarded on, it will receive a stamp. In this case the stamp is an email header.

List of Email Header Fields

IANI maintains a list of email headers here.

405 questions
2
votes
1 answer

How to remove header auto-submitted: auto-generated in exchange 2013

I want to forward email from my support adresse support@mydomain.com to my Zendesk address mydomain@zendesk.com in a way that preserves the original sender, AND without exchange adding the header auto-submitted: auto-generated to all emails.…
OleK
  • 21
  • 1
  • 4
2
votes
2 answers

php mail() headers prevent email from sending

I won't lie. I don't really understand some of the code I have used in the header for this mail function. I have been trying to fix it myself and some of the code is copied from other forum posts etc. The $email, $subject, and $msg variables are…
Tunna182
  • 343
  • 3
  • 16
2
votes
0 answers

Is there any way to get my custom email headers in bounce back email header section instead of in message body using c#

I'm sending emails with few custom headers in emails using SmtpClient (C#). If any email bounce back due to wrong recipient email id, then I need to track those bounce back emails by reading those email using pop3 in c#. Is there any way to do some…
Shiv Kumar
  • 31
  • 4
2
votes
1 answer

Can I add custom Message-ID and In-Reply-To header using phpmailer?

I am using phpmailer for sending emails, I am attempting to add In-Reply-To in email header but I can't. How can I achieve this? Can I use any message-ID or references when I am sending a email? Is there anything else to add references or…
Mahedi Hasan
  • 178
  • 1
  • 11
2
votes
2 answers

UTF-8 quoted-printable, multiline subject for Thunderbird?

Let's say I want to compose an email header with UTF-8, quoted-printable encoded subject, which is "test — UNIX-утилита для проверки типа файла и сравнения значений". I can confirm the bytes of the characters using: $ echo "UNIX-утилита ..." | perl…
sdaau
  • 36,975
  • 46
  • 198
  • 278
2
votes
1 answer

How to get decode this attachment filename with python?

I already decoded a lot of email attachments filenames in my code. But this particular filename breaks my code. Here is a minimal example: from email.header import…
guettli
  • 25,042
  • 81
  • 346
  • 663
2
votes
1 answer

How can I change the header of WordPress 'retrieve_password' email?

I noticed WordPress give us some filters to customize the password reset request email like wp_mail_from, retrieve_password_title and retrieve_password_message and these last two are executed in the retrieve_password function at wp-login.php as…
Murilo
  • 728
  • 6
  • 13
2
votes
4 answers

Php Mail() function: Headers was printed

I was trying to send mail in PHP with mail() function. The email sent successfull and it's exist in the inbox. The problem is the headers printed in the email header. I've tried the various code for the headers. 1.The first goes like this: $headers…
merli
  • 25
  • 9
2
votes
1 answer

Create custom mail header field

I'm making a program which sends invoices to registered users as PDF attachment. Each invoice is identified by a GUID. In some circumstances I want to be able to find programmatically the GUID from mail without reading PDF file. Can I use mail…
Arseni Mourzenko
  • 50,338
  • 35
  • 112
  • 199
2
votes
0 answers

PHPMailer: Change From field in header

I have a customer support form that submits to PHP which uses the latest version of PHPMailer to send an email from my new hosted SMTP server to a support ticket system. Using the old SMTP server I was able to set the $mail->From field to the…
Super_Bob
  • 21
  • 2
2
votes
0 answers

Reasoning behind change in destination address requirement from RFC 822 to RFC 2822

In RFC 822 a destination address was required to appear in the headers, section C.3.4. reads "A message must contain at least one destination address field. 'To' and 'CC' are required to contain at least one address." In RFCs 2822 and 5322, section…
craigyurt
  • 21
  • 3
2
votes
1 answer

CFMail "mailerid" attribute - What does it do?

I have a question regarding the mailerid attribute for the tag in Coldfusion... According to the documentation, I understand that this dictates the X-Mailer header that is sent with the email. I also understand that this is typically meant…
aepearson
  • 81
  • 1
  • 5
2
votes
1 answer

Extra line breaks in email headers

I have a webmail system and for some time now have noticed that emails originating from a few servers come with an extra line break in the headers. First was with the occasional Dmarc report from Google. About one a week. Then other automated emails…
transilvlad
  • 13,974
  • 13
  • 45
  • 80
2
votes
2 answers

Find out from where an email has been sent

I'd like to find out from where an email has been sent. I already know I have to to find the "Received From" that’s farthest down in the complete headers to get the private and the public IP addresses. But I'm a little bit confused when the private…
Neoph
  • 21
  • 1
  • 3
2
votes
1 answer

utf-8 mimeheader, PHP mail() adds @domain in "From:" field

I send email with PHP's mail() function. I need to have the from field encoded in UTF-8 so I set these mail headers: function mail_headers($from, $contentType = "text/plain") { $headers = "From: ".mime_header_encode($from)."\n"; $headers .=…
koubic
  • 597
  • 1
  • 11
  • 23