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
11
votes
2 answers

Parsing Thread-Index Mail Header with Python

Some mail clients, don't set the References headers, but Thread-Index. Is there a way to parse this header in Python? Related: How does the email header field 'thread-index' work? Mail 1 Date: Tue, 2 Dec 2014 08:21:00 +0000 Thread-Index:…
guettli
  • 25,042
  • 81
  • 346
  • 663
10
votes
4 answers

Is it possible to decode a SPAMCAUSE field in a mail header?

I'd like to decode this string: X-OVH-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeelgedrvdduucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfenuceurghilhhouhhtmecufedttdenucgohfhorhgsihguuggvnhfjughrucdlhedttddm How can I do this?
Sylvain Huck
  • 141
  • 1
  • 5
10
votes
1 answer

How to cause sent emails to appear threaded in GMail recipient's view with Message-ID, In-Reply-To and References

I've read some great online resources like http://www.jwz.org/doc/threading.html, and it seems that any email is send with a Message-ID header, then any replies to it include In-Reply-To naming that ID and Refences which can name a list of parent…
Neek
  • 7,181
  • 3
  • 37
  • 47
10
votes
3 answers

Using Gmail message source, generate direct link

So using the gmail message source is it possible to generate, a link to the message/thread in GMail's own interface? on http://productforums.google.com/forum/#!topic/gmail/goChl1gG0NQ they use the following…
arnonymous
  • 101
  • 1
  • 4
9
votes
1 answer

What is ZuckMail ?

X-Mailer: ZuckMail [version 1.00] I mean is this custom-made smtp mailer? or X-Mailer header with custom value like X-Mailer:myMailer ?
Ben
  • 1,906
  • 10
  • 31
  • 47
9
votes
1 answer

Email header for a profile picture or avatar?

I am playing around with the python mailjet api, and found that I can set the sender's name so instead of emails showing up from "Info" (info@example.com) I can have them show up from "Carlos". I would also like to add a profile picture like that of…
Chase Roberts
  • 9,082
  • 13
  • 73
  • 131
8
votes
3 answers

Force a new email thread

When writing an application that sends email based on certain events, I would like to enforce the rule that each of these emails starts a new "conversation". Email systems such as Gmail like group email messages into "conversations", such that…
tylerl
  • 30,197
  • 13
  • 80
  • 113
7
votes
0 answers

How to set display name when sending with GMail API?

With the Gmail API, if you do not provide a FROM header, the FROM header is set to the sender's email address. If I set the FROM header to any of the following forms, Gmail displays a phishing warning to my recipients, stating "Be careful with this…
Monty123
  • 103
  • 1
  • 7
7
votes
3 answers

Sending email using smtp and setting the message-id

I have a client which sends email using the smtp protocol. The client can be configured against any mail server which supports smtp (for example: gmail, yahoo). Now, while sending the mail from client, I am setting the "message-id" in the header.…
Kunal
  • 151
  • 1
  • 2
  • 6
7
votes
1 answer

E-Mail Header: MIME-Version: 1.0 - When should this be used?

This could be rightfully construed as a beginner's question. Consider the following e-mail header: MIME-Version: 1.0 My Questions: When should you stamp an e-mail with this header? When should you omit this e-mail header? EDIT: Is it true that…
Jim G.
  • 15,141
  • 22
  • 103
  • 166
7
votes
2 answers

What's the easiest/cleanest way to get the MessageID of a sent email?

I want to save the MessageID of a sent email, so I can later use it in a References: header to facilitate threading. I see in root/django/trunk/django/core/mail.py (line ~55) where the MessageID is created. I'm trying to think of the best way to…
Aaron McMillin
  • 2,532
  • 27
  • 42
7
votes
1 answer

Custom Email Headers in Laravel 4

I can't seem to locate the method within the Laravel 4 docs/Email API where I can add custom headers to an email. For example: Mail::send('emails.welcome', $data, function($message) { $message->to('foo@example.com', 'John…
eski009
  • 371
  • 1
  • 6
  • 14
7
votes
4 answers

accented words in email subject break spacing - how do I stop this?

We have a custom php email marketing app, and an interesting problem: If the subject line of the message contains a word with accents, it 'swallows' the spaces between it and the following word. An example: the phrase Ángel Ríos escucha y sorprende…
Adriano Varoli Piazza
  • 7,297
  • 5
  • 39
  • 50
7
votes
3 answers

Is there an error in PHP's imap_fetch_overview()-function when reading headers with brackets?

I'm sending an E-Mail in PHP using the following code:
R_User
  • 10,682
  • 25
  • 79
  • 120
7
votes
3 answers

mail() from php.net manual: difference between "to" and "to-header"

In the php.net example for mail(), two different addresses are used for $to and the additional header information "To: ...":
Chris
  • 3,756
  • 7
  • 35
  • 54
1
2
3
26 27