SMTP

Simple Mail Transfer ProtocolApplication layer · OSI 7

Submitting outgoing mail and relaying it between domains

Step 1 of 6: Connect securely to submit mail. When Alice hits Send, her mail app dials her provider on port 465. TLS starts right after the connection opens, shielding her password and email before any SMTP line goes out.
0.0 s / 21.0 s
Alice's laptop192.168.1.10
EncryptedResponseRequestDataLookup

Overview

is how email leaves your device for your mail provider, and how that provider forwards it to the recipient's domain. Each command gets a three-digit status reply.

Simple Mail Transfer Protocol (RFC 5321, submission RFC 6409) operates over TCP using text commands (EHLO, MAIL, RCPT, DATA) and 3-digit reply codes. Reading mail later uses or .

Key facts

Layer
Application (over TCP)
Ports
465 / 587 submission, 25 relay
Security
Implicit TLS (465) or STARTTLS
Core commands
EHLO, MAIL FROM, RCPT TO, DATA
Defined in
RFC 5321, RFC 6409, RFC 3207

Email relayed to Bob's mailbox

Alice's app signed in over TLS to hand off the message, her provider looked up Bob's mail server via DNS MX records, upgraded the relay link with STARTTLS, and delivered the signed mail.

Completed port 465 implicit TLS submission, DNS MX/A resolution, port 25 STARTTLS upgrade, and DKIM-signed SMTP delivery.

Route
Laptop -> provider -> Bob's MX
Submission
Port 465 (TLS + AUTH)
Relay
Port 25 (STARTTLS)
Authentication
SPF, DKIM, DMARC checks

Try it yourself

Look up a domain's MX mail servers

Ask DNS which hostnames receive email for a domain.

nslookup -type=mx example.com