Skip to main content

What does it actually take to send an email?

·3 mins

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 #

%%{init: {'theme': 'default', 'themeVariables': { 'textColor': '#798189'}}}%% sequenceDiagram participant User as Sending User participant Client as Email Client participant SMTP as SMTP Server participant DNS as DNS Server participant MTA as Recipient's Mail Server participant Mailbox as Recipient's Mailbox participant Recipient as Receiving User User->>Client: Hits "Send" Client->>SMTP: Connects to SMTP Server Client->>SMTP: Converts and sends email SMTP->>DNS: Resolves recipient's email address DNS-->>SMTP: Returns IP address SMTP->>MTA: Connects and sends email MTA->>SMTP: Verifies sending server MTA->>MTA: Runs virus/spam checks MTA->>Mailbox: Delivers email Mailbox->>Recipient: Sees email
  1. Sending user hits “Send”.
  2. The email client connects to its corresponding Simple Mail Transfer Protocol (SMTP)3 server.
  3. The email client converts the email into the Internet message structure described above.
  4. The client then sends4 the converted message to the SMTP server.
  5. The SMTP server will resolve the recipient’s email address into an IP address with a DNS5 lookup.
  6. The SMTP server connects to and sends the email to the recipient’s email server, which is a Mail Transfer Agent (MTA)6.
  7. The recipient email server will verify the sending SMTP server. It may run checks for viruses or spam detection here.
  8. The recipient server accepts the request and receives the email via the SMTP protocol.
  9. The recipient server validates the recipient mail account, and delivers the email to the receiving user’s mailbox.
  10. 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.


  1. An email client is sometimes referred to formally as a Mail User Agent (MUA) ↩︎

  2. 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. ↩︎

  3. SMTP is specified in RFC 5321 ↩︎

  4. RFC 6409 outlines how messages are submitted for SMTP ↩︎

  5. This information is based on MX DNS records that the recipient has defined. ↩︎

  6. An MTA is capable of receiving messages ↩︎