RFC 821: the document that defined SMTP and how email sending works

The 1982 text that set out how servers pass mail to each other, and why its rules still sit behind every email you send

RFC 821 is the document that defined the SMTP protocol in 1982, the system servers use to pass email to each other. Every time you send an email, your message travels following rules that were born in that text.

Here you’ll find what it is, what it establishes, how it has evolved into today’s RFC 5321 and how it relates to your sends.

What is RFC 821?

An RFC (Request for Comments) is a technical document published by the IETF to describe how a part of the internet works. RFC 821 was published in August 1982 under the title Simple Mail Transfer Protocol and was written by Jonathan B. Postel.

It defines SMTP: which commands two servers exchange to deliver an email, in what order, and how the receiving server responds. It was born on the ARPANET network, when email was starting to connect universities and research centers.

It shouldn’t be confused with RFC 822, published that same month. RFC 821 defines how mail is transported and RFC 822 how the message is written, which is known today as the Internet Message Format.

From RFC 821 to RFC 5321

The protocol has been revised twice without changing its essence:

DocumentYearWhat it brought
RFC 8211982First definition of SMTP, by Jonathan B. Postel.
RFC 28212001A revision that brings together almost twenty years of improvements.
RFC 53212008Current version of SMTP.

Along the way, important extensions were added. The EHLO command, which replaces HELO, lets servers announce which features they support (ESMTP, from 1995). Other extensions added STARTTLS encryption and user authentication.

Evolution of SMTP: RFC 821 in 1982, RFC 2821 in 2001 and RFC 5321 in 2008, the current version

How an SMTP conversation works

When one server delivers an email to another, the two hold a very simple text dialogue:

  1. Greeting. The sending server introduces itself with HELO (or EHLO).
  2. Sender. It states who is sending with MAIL FROM.
  3. Recipient. It states who the message is for with RCPT TO, once per recipient.
  4. Message. With DATA it sends the headers and the body, ending with a line that contains only a period.
  5. Closing. It ends the conversation with QUIT.

At each step, the destination server responds with a three-digit code. If it starts with 2, all is well. If it starts with 4, it’s a temporary error and the send can be retried. If it starts with 5, the rejection is permanent: the origin of a hard bounce.

What an SMTP conversation looks like according to RFC 821: HELO or EHLO, MAIL FROM, RCPT TO, DATA and QUIT, with responses 2xx success, 4xx temporary error and 5xx permanent rejection

Let others speak SMTP for you

Mailrelay interprets bounces, retries temporary errors and removes contacts that don’t exist. 80,000 free emails a month.

What still applies from RFC 821

More than forty years later, much of the original design is still in use:

  • Port 25 for mail between servers. Applications usually send through SMTP port 587.
  • The basic commands HELO, MAIL FROM, RCPT TO, DATA and QUIT.
  • The three-digit response codes, which are the ones you read in a bounce.
  • The separation between envelope and message. The envelope sender (MAIL FROM) doesn’t have to match the From the recipient sees. That’s why the Return-Path exists.

What RFC 821 didn’t foresee was spam. The protocol didn’t check who was sending, which is why SPF, DKIM and DMARC are used today to verify the sender.

What it has to do with your email marketing

Every campaign you send reaches Gmail, Outlook or Yahoo via SMTP. The bounces you see in your statistics are actually the 4xx and 5xx responses from the destination server. Understanding that dialogue helps you tell whether an email didn’t arrive because of a nonexistent mailbox, a full mailbox or a block.

If you send from your own server with software such as Sendmail or Exim, you manage that conversation and your IP’s reputation. With an email marketing platform, the platform takes care of it.

How Mailrelay Helps You

Mailrelay handles the SMTP side of your campaigns. It interprets server responses, retries temporary errors and marks contacts with permanent errors as bounced so they stop receiving sends. You can also set up SPF and DKIM for your domain from the dashboard.

If your website or app needs to send email, Mailrelay’s SMTP is included in the Standard and Enterprise plans, with a 30-day trial on the free account. The free account lets you send 80,000 emails a month to 20,000 contacts, with human support on every plan.

Send from your website with Mailrelay’s SMTP

SMTP on Standard and Enterprise, a 30-day trial on the free account and human support on every plan.

Frequently Asked Questions

Is RFC 821 still in force?

No. It was replaced by RFC 2821 in 2001, which was in turn replaced by RFC 5321 in 2008, the current standard. Even so, the basic workings of SMTP are still the ones RFC 821 described.

What’s the difference between RFC 821 and RFC 822?

RFC 821 defines SMTP, the protocol that transports mail between servers. RFC 822 defines the message format: headers, a blank line and the body.

Who wrote RFC 821?

Jonathan B. Postel, one of the pioneers of the internet, who also edited the RFC document series for years.

Key takeaways about RFC 821

It’s the 1982 document that defined SMTP, the protocol mail travels on between servers. Today it has been replaced by RFC 5321, but its commands, its response codes and port 25 are still in use, and they’re what explain your bounces.

Related entries