What does it actually take to send an email?
Many of us send or receive emails everyday, and we don’t give it much thought. Generally everything works fine and messages make it to the right places anyway.
It’s a lot like magic, which can be said about a lot of computing. But what’s truly involved in accomplishing this?
Let’s walk through it!
Suppose you have your email message, maybe it’s an exciting announcement, and you’ve composed in your favorite email client1. You fill out the recipient and subject fields, then hit send – a bunch of stuff happens!
What does an email look like? #
While the email client makes writing and editing an email quite easy, under the hood, the email is represented as an “Internet message”. RFC 5322 describes how this structure works. It can get quite complex depending on whether the email contains special characters, images, or attachments. These rely on the Multipurpose Internet Mail Extensions (MIME) standard2.
Here is a simple example:
From: sender@some-cool-example.com
To: recipient@another-cool-example.com
Subject: Ahoy!
Date: Sun, 8 Dec 2024 10:00:00 -0500
This is the body of the email message.
The entire flow #
- Sending user hits “Send”.
- The email client connects to its corresponding Simple Mail Transfer Protocol (SMTP)3 server.
- The email client converts the email into the Internet message structure described above.
- The client then sends4 the converted message to the SMTP server.
- The SMTP server will resolve the recipient’s email address into an IP address with a DNS5 lookup.
- The SMTP server connects to and sends the email to the recipient’s email server, which is a Mail Transfer Agent (MTA)6.
- The recipient email server will verify the sending SMTP server. It may run checks for viruses or spam detection here.
- The recipient server accepts the request and receives the email via the SMTP protocol.
- The recipient server validates the recipient mail account, and delivers the email to the receiving user’s mailbox.
- Receiving user sees the email.
Note: the above is a simplified view, and in practice, there are a lot of delivery issues and errors that can happen.
-
An email client is sometimes referred to formally as a Mail User Agent (MUA) ↩︎
-
The MIME standard is based on RFC 2045, RFC 2046, RFC 2047, RFC 4289, and RFC 2049. Note that there may be updates or extensions to these in future RFCs. ↩︎
-
This information is based on MX DNS records that the recipient has defined. ↩︎