← Lessons

quiz vs the machine

Silver1050

Networking

How Email Is Delivered with SMTP

The hop by hop journey of a message from sender to mailbox.

4 min read · intro · beat Silver to climb

The Delivery Protocol

SMTP (Simple Mail Transfer Protocol) is the language servers speak to move mail across the internet. It is a push protocol: a sending server hands a message to a receiving server, which may relay it again until it reaches the recipient's mailbox.

The Conversation

An SMTP exchange is a short text dialog over a TCP connection.

  • The client greets with HELO or EHLO and announces itself.
  • It states the sender with MAIL FROM and each recipient with RCPT TO.
  • It sends the body after the DATA command and ends with a single dot.
  • The server replies with numeric codes such as 250 for success.

Submission vs Relay

Your mail client submits outgoing mail on port 587 with authentication. Servers relay between each other on port 25. Final pickup into a client uses IMAP or POP3, not SMTP, because SMTP only moves mail toward a mailbox.

Key idea

SMTP is a push protocol that relays mail server to server using a simple text dialog, while clients fetch delivered mail with IMAP or POP3.

Check yourself

Answer to earn rating on the learn ladder.

1. What kind of protocol is SMTP?

2. Which protocols fetch already delivered mail into a client?