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

Replacing deprecated eregi() with stristr(). Is this php mail script secure from header injections?

I've been using the same php script to send emails from contact forms for years. But when my web server upgraded to php 5.3 the call to eregi was causing deprecated errors to display. After a Google search I learned that I could use stristr instead…
Evster
  • 2,552
  • 2
  • 16
  • 14
2
votes
2 answers

working with Email headers - PHP

I'm piping my incoming emails to a handler.php. I can pipe it successfully and it's working, but when it gets to getting out the variables from mail header, for example the "Subject", or "To", or the "message body", I'm experiencing some problems.…
behz4d
  • 1,819
  • 5
  • 35
  • 59
2
votes
2 answers

Attach custom email header for Amazon SES service

I'm using Amazon SES to send emails, I would like to attach a custom header to it before it gets sent to users since I'm making a proxy email system, for replying to threads on my site, so the ID is kept for tracking which thread to post to with the…
MacMac
  • 34,294
  • 55
  • 151
  • 222
2
votes
2 answers

When I send an Email through Dynamics CRM how can I add mail headers

I want to edit the E-mail template in my Dynamics CRM 2011 solution. I will add a combo box to the form that allows a user to decide what classification the email should be eg. "A", "B" or "C" This helps our email gateway know what to do with…
Peter
  • 7,792
  • 9
  • 63
  • 94
2
votes
1 answer

Will a custom email header be included in reply emails?

I am writing a C# application to send emails with custom headers. If I send an email to someone with a custom header and they reply back, will it retain that custom header in the reply back?
michael
  • 14,844
  • 28
  • 89
  • 177
2
votes
1 answer

ruby mailman remove header from email body

I am trying to display an email body in my RoR project. class IncomingMail def initialize(message, params) if person = Person.find_by_email(message.from) changeMessage = Message.where({person_id: person.id}) #message =…
1
vote
1 answer

Sender address vs. SMTP server address

My software (based on LAMP) provides a simple solution for sending email newsletters. What I want is to extend the functionality for this feature. I have a dedicated server setup at a trusted provider, and my ISP has an SMTP (eg.…
hansch
  • 172
  • 1
  • 2
  • 10
1
vote
0 answers

Force Java MimeUtility.encodeWord to always encode

String encodedString = MimeUtility.encodeWord(myString, "utf-8", "Q"); The MimeUtility.encodeWord only encodes if a non US-ASCII character is found. For best use in a email header i want to always encode like this. So is it a way to force it to…
1
vote
1 answer

Email reply: should I strip (Re|Fw(d)?), or any word with a colon?

I am writing a program that composes an email reply. The original email may be a reply already. How should I handle the subject? I have seen the everything-before-the-colon method used. This could affect a situation re[2]:. If the colon method was…
700 Software
  • 85,281
  • 83
  • 234
  • 341
1
vote
2 answers

Ruby custom email headers

I'm trying to send an email with custom headers but for some reason they just don't get through. When I call my mailing method in the console, my custom parameter is actually listed: This is what I'm doing in…
user393964
1
vote
1 answer

How to remove X-Source-Dir from PHP-generated mails?

Coincidentally I notice that mails sent out by a PHP script include X-AntiAbuse and X-Source headers that include details about the server and script sending these e-mails. These are useful to track down abuse and locate the culprit. However, in one…
user943301
1
vote
1 answer

E-Mail in PHP, message threading, regex probably needed

I'm working on something that logs e-mail messages sent to a certain address. I have a PHP script that puts the info into MySql, which is working fine. I need to be able to group messages based on the 'conversation' similar to Gmail, and have…
Sherwin Flight
  • 2,345
  • 7
  • 34
  • 54
1
vote
3 answers

SMTP MIME header with attachment

I am trying to create a PHP function to send an e-mail using SMTP with an attachment. I am having a hard time trying to create the MIME headers as I want the body to include text in HTM format and the file to be attached.I am using a very old…
Rick
  • 2,288
  • 18
  • 66
  • 98
1
vote
1 answer

Why is Gmail blocking some emails with emoji's in header?

Gmail is ISP blocking emails I am sending and giving this error message: smtp;550 5.7.1 The message contains a unicode character in a disallowed header. Please visit https://support.google.com/mail/?p=BlockedMessage to review our message and header…
1
vote
0 answers

.ics file events not being added to calendar automatically

I'm trying and failing to get .ics files (that have been sent as an email attachments) to be automatically added to the user's calendar. This Apple discussion suggests this has been stopped, but I'm almost certain that I've been sent .ics files…