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

Multiple headers are being sent when sending email via C# and IIS smtp

I am sending emails via my C# application the way below MailMessage mail = new MailMessage(); mail.To.Add(srEmail); mail.From = new MailAddress("noreply@monstermmorpg.com", srSender); mail.Subject = srEmailTitle; mail.Body =…
Furkan Gözükara
  • 22,964
  • 77
  • 205
  • 342
2
votes
2 answers

Are custom mail headers preserved after reply?

I'm currently trying to design a PHP webapp that allows users to send emails to other users. The recipient can then reply to the email and the message will be updated in the webapp. Now to keep track of each individual user message, I would like to…
user2385136
2
votes
3 answers

PHP email Headers - delivery option

I've added the following code to our PHP Mail app which sends out emails: $email_header .= "Disposition-Notification-To: $from"; $email_header .= "X-Confirm-Reading-To: $from"; However, we are not receiving any 'Delivered' or 'Read'…
Homer_J
  • 3,277
  • 12
  • 45
  • 65
2
votes
7 answers

Decoding Base64 / Quoted Printable encoded UTF8 string

In my ASP.Net application working process, I need to do some work with string, which equals something like =?utf-8?B?SWhyZSBCZXN0ZWxsdW5nIC0gVmVyc2FuZGJlc3TDpHRpZ3VuZyAtIDExMDU4OTEyNDY=?= How can I decode it to normal human language? Thanks…
insomnium_
  • 1,800
  • 4
  • 23
  • 39
2
votes
1 answer

Properly folding (wraping) header lines in email

I have a PHP function to email subscriptions to users. I use the BCC so the users cannot see each other, and everything works great, with one exception: I worry about having too many emails per line such that the header line is too long. Note: I do…
steveo225
  • 11,394
  • 16
  • 62
  • 114
2
votes
1 answer

Extra spaces in e-mail subject using chilkat

We're using Chilkat mail for Visual C++ 8.0. We have a problem with decoding extra spaces in subject for some e-mails. The subject in these e-mails has got few encoded words like (two below): =?utf-8?Q?Some text in he?= =?utf-8?Q?re?= According to…
Bartosz Rosa
  • 132
  • 3
  • 11
2
votes
5 answers

Regex to extract Content-Type

How can extract the lines with the Content-Type info? In some mails, these headers can be in 2 or 3 or even 4 lines, depending how it was sent. This is one example: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding:…
Carven
  • 14,988
  • 29
  • 118
  • 161
2
votes
2 answers

Using Return-path when sending mail through SMTP using PHP

Is there a way to set the Return-path when sending mail through authenticated SMTP using PHP? I want bounce mails to be caught by another e-mail address than the "from" address. I know that there is a way to do this with the "normal" PHP mail()…
neoMagic
  • 420
  • 4
  • 9
2
votes
2 answers

How do i specify X-Headers for outgoing emails in Microsoft Outlook 2010

I need to include custom headers in my outgoing emails. I'm using Microsoft Outlook 2010 and SendGrid SMTP server. In particular, i want to specify a unique tracking ID on each mail using SendGrid's X-SMTPAPI header. My Approach: I am build an…
Charles Okwuagwu
  • 10,538
  • 16
  • 87
  • 157
2
votes
2 answers

Regex to catch email addresses in email header

I'm trying to parse a To email header with a regex. If there are no <> characters then I want the whole string otherwise I want what is inside the <> pair. import re re_destinatario = re.compile(r'^.*?.*)>?') addresses = [ 'XKYDF/ABC…
Clodoaldo Neto
  • 118,695
  • 26
  • 233
  • 260
2
votes
0 answers

Gmail ignoring Reply-To header

I have a website that allows visitors to fill in a form with their name, email address, and a question, and this is sent as an email message to the nominated website member. The email messages are plain text and contain a 'Reply-To' header with the…
MattRowbum
  • 2,162
  • 1
  • 15
  • 20
2
votes
0 answers

How to parse "Received: " header properly in Java

I am looking for an RFC 2821 standard parser in Java that can parse the Received: line in Email Headers properly. There have been a lot of inconsistencies in the Received line format and tracing back to the sender source is becoming difficult. For…
2
votes
1 answer

Edit header in '.eml'

As a brief summary, I have a bunch of '.eml' files in a directory. I need to forward these emails back to 'email@example.com'. The problem is that the field 'From' in the header of the '.eml' file contains another email address which doesn't match…
2
votes
1 answer

Avoiding PHP double To: header

I am using the php mail function to send emails. I pass in the to address and I also build out some additional email headers, including From: and Reply-To:. However until now I have also been including a To: header in the additional headers. For eg…
Gotts
  • 2,274
  • 3
  • 23
  • 32
2
votes
0 answers

How to set repeated headers without overwriting when creating email using VBScript CDO.Message?

I am attempting to generate some emails using VBScript CDO.Message, code is below. The receiving clients, IBM (Lotus) Notes, require a number of pieces of information supplied using one header "X-Notes-Item" repeated many…
antwebb
  • 21
  • 3