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

Broken syntax in Postfix header_checks

I`m setting up Postfix to edit the headers dependent on the reciever. This is done through header_checks(http://www.postfix.org/header_checks.5.html) The logic is as follows: If the e-mail is sent to "erik@sorgaard.net" then we copy the From field…
0
votes
1 answer

If there a reliable way to identify an email message as a forward?

I think the answer is no, but I thought I'd ask in case someone knows better. The application I work on accepts incoming email, I'm trying to find a way to identify a message as having been forwarded (not server-side forwarding, just a regular old…
derikb
  • 59
  • 1
  • 7
0
votes
2 answers

PHP mail header problems

I have two problems currently: In my gmail, the From: header doesn't respect the 'My contact form' name. It's defaulting to something else. When I receive the email in gmail, it is of course being sent from myemail@mydomain.com (to avoid the spam…
Jefe
  • 67
  • 6
0
votes
1 answer

Emails sent from Java not received at Yahoo & Gmail

I have a problem where a piece of code in java sends emails just fine except to public emails like Yahoo & Gmail. Here are the headers for the email I receive when sent to my company email address: Date: Wed, 30 Apr 2014 10:56:05 -0400 From:…
goe
  • 343
  • 1
  • 4
  • 13
0
votes
2 answers

PHP mail headers is not working properly

I'm sending mails using the PHP mail() function. The mail headers is not working properly. $charset = mb_detect_encoding($message); $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'From: '.$from . "\r\n"; $headers .= 'Content-type:…
Sithu
  • 4,752
  • 9
  • 64
  • 110
0
votes
3 answers

From address is not working for PHP mail headers

I'm sending "no-reply" mails using PHP mail function. The problem is that mails were sent, but not receiving in my inbox when I use the following "From" headers: From: Sender Name From: noreply@localhost.com From: Sender…
Sithu
  • 4,752
  • 9
  • 64
  • 110
0
votes
1 answer

SMTP: In which order which "from" email address would be used?

I'm currently coding from scratch a new SMTP server and I'm asking in which order "from" address counts? If I receive an email with the following content: Return-Path: foo1@bar.tld ... From: Foo Bar and the email was received by the…
0
votes
1 answer

Is there any email clients which strip our email headers?

I wanted to know if there's any email clients (e.g. Outlook, etc.) which strip out custom email headers e.g. X-Tallyfy-Y-Z : value The reason is that I'm adding headers to email so that plugins for Gmail and Outlook can take a certain action if…
0
votes
0 answers

Excluding email headers

I am looking for a regex to exclude mail headers in a given document. Not sure how it has to be done I tried creating a reg ex to identify an address following From field, But the email address could be more and i do not have an option to create a…
0
votes
0 answers

PHP Mail Form: From Name indicates $name@hostdomain.com instead of user provided email and name

I am trying to set up a simple contact form for my website. The end goal of the form is for the user to submit their information and have the server process and deliver the email as if it came directly from the user. In other words, if John Doe,…
jjcarlson
  • 73
  • 1
  • 5
0
votes
0 answers

Why isnt my spf being received in every header?

Just setup my spf record on my server and getting confused. I send an email from my now spf secured address (example@emailwithspf) to my gmail account (example@gmail), check the headers and it shows SPF worked and passed (Received-SPF: pass…
FoxyFish
  • 874
  • 1
  • 12
  • 21
0
votes
1 answer

Javax.mail changes mime headers

I need to specify a particular headers to a MimeMessage. MimeMessage mMessage = new MimeMessage(session); ... mMessage.setRecipients(Message.RecipientType.TO, tosAddr); mMessage.setHeader("MIME-Version", "1.0"); mMessage.setHeader("Content-Type",…
Tobia
  • 9,165
  • 28
  • 114
  • 219
0
votes
2 answers

Rails 4 ActionMailer headers

I'm on Rails 4 and I've got one mailer. This was created following the tutorial in the docs. class UserMailer < ActionMailer::Base @delivery_options = { user_name: 'user_name', password: 'password', address:…
emersonthis
  • 32,822
  • 59
  • 210
  • 375
0
votes
1 answer

how to remove 'via' or 'mailed by' in email using php mail function

Following is how I am using the php mail function to send emails to registered users in my website: mail($email, $subject, $message,'From: MySite ', "-f hello@mysite.com"); The problem is that the recipients are getting 'From…
maaz azad
  • 1
  • 1
  • 1
0
votes
1 answer

custom email headers - cakephp 1.3

How do I go about setting custom email headers within cakephp 1.3? I am trying the following: $this->Email->headers = array('X-statusID' => $status_id); But the header does not exist in the email when I read it using PHP IMAP. Thanks
sluggerdog
  • 843
  • 4
  • 12
  • 35