PROTOCOL EXPLORERLearn how the internet works
Now learningSMTP · Sending emailOverview · 5 steps
Learning progress0%
0 / 14 complete · 0 in progress
Mail Server198.51.100.25InternetRouter192.168.1.1Client192.168.1.10

Protocol overview

SMTP

Active

Simple Mail Transfer Protocol

Submit a message using a mail envelope and a DATA body. Distinguish SMTP delivery from the POP3 or IMAP protocols used to access a mailbox.

Layer
Application (Layer 7)
Default port
25 relay / 587 submission
Transport
TCP; often TLS
Data format
Text commands + message body
Defined in
RFC 5321, RFC 3207
Read the complete guide ↗

Packet flow

DNSTCPRequestResponse
No.TimeSourceDestinationProtocolInfoSize
10.000s198.51.100.25192.168.1.10SMTP220 mail.example.com ESMTP82 B
20.024s192.168.1.10198.51.100.25SMTPEHLO client.example.com79 B
30.048s198.51.100.25192.168.1.10SMTP250-mail.example.com90 B
40.072s192.168.1.10198.51.100.25SMTPSTARTTLS64 B
50.096s198.51.100.25192.168.1.10SMTP220 Ready to start TLS78 B
60.120s192.168.1.10198.51.100.25SMTPMAIL FROM:<sender@example.com>86 B
70.144s198.51.100.25192.168.1.10SMTP250 OK62 B
80.168s192.168.1.10198.51.100.25SMTPRCPT TO:<reader@example.net>84 B
90.192s198.51.100.25192.168.1.10SMTP250 OK62 B
100.216s192.168.1.10198.51.100.25SMTPDATA60 B
110.240s198.51.100.25192.168.1.10SMTP354 End with <CRLF>.<CRLF>82 B
120.264s192.168.1.10198.51.100.25SMTPFrom: sender@example.com146 B
130.288s198.51.100.25192.168.1.10SMTP250 Queued66 B
140.312s192.168.1.10198.51.100.25SMTPQUIT60 B

How SMTP Sends Email

Trace an SMTP conversation from EHLO and STARTTLS through MAIL FROM, RCPT TO and DATA. Learn how envelope addresses differ from message headers.

Understanding SMTP

Submit a message using a mail envelope and a DATA body. Distinguish SMTP delivery from the POP3 or IMAP protocols used to access a mailbox.

Default port
25 relay / 587 submission
Transport / carrier
TCP; often TLS
Category
application

What to look for in the lab

Compare MAIL FROM and RCPT TO with the From and To headers in DATA. The commands set the routing envelope. The headers belong to the message and are what a mail reader displays.

1. Greet the server

A server greeting starts the session. EHLO lets the client discover extensions such as STARTTLS and supported authentication mechanisms.

2. Protect the session

When STARTTLS succeeds, a TLS handshake follows and the client sends EHLO again. This lab shows the SMTP layer; real credentials should travel over protected submission.

3. Set envelope addresses

MAIL FROM sets the return path; RCPT TO specifies a recipient. These envelope addresses are distinct from visible From and To headers.

4. Transfer the message

After 354, the client sends headers and body, ending with CRLF-dot-CRLF. Lines beginning with a dot are escaped by dot-stuffing.

5. Accept responsibility

A successful 250 after DATA means the server accepted responsibility, not that a person has read the message. QUIT ends the SMTP session.

Protocol relationships

Protocols cooperate across layers. Compare the neighboring lessons to distinguish addressing, delivery, application semantics and encryption.

Standards and editorial method

Written and implemented independently by NavSprout. Lessons summarize public protocol standards using synthetic documentation addresses and fictional credentials. Consult the standards for complete wire formats and normative behavior.

RFC 5321 ↗ RFC 3207 ↗

Check your understanding

Which command specifies an envelope recipient?