Learn how email works behind the scenes. Watch the flow, explore each command, and practice in a realistic simulated terminal.
Watch emails travel from sender to recipient in real time
Learn each SMTP command with examples and explanations
Practice typing real SMTP commands in a simulated telnet session
How an email travels from the sender to the recipient through SMTP servers
Click each command to see its syntax, example, and a detailed explanation
Identify yourself to the server
The client initiates the conversation by identifying itself. EHLO (Extended HELO) is the modern version that also queries the server for supported extensions like STARTTLS, AUTH, and 8BITMIME. HELO is the legacy version that only identifies the client.
Specify the sender address
Specify the recipient address
Begin sending the email content
End the SMTP session
Authenticate to the server
Upgrade to encrypted connection
Reset the current transaction
Every SMTP response includes a 3-digit status code — here's what they all mean
| Code | Meaning | Description |
|---|---|---|
| 211 | System status | Help message from the server |
| 220 | Service ready | SMTP server is ready to accept connections |
| 221 | Closing connection | Server is closing the transmission channel |
| 235 | Auth success | Authentication completed successfully |
| 250 | OK | Requested action completed successfully |
| 334 | Auth challenge | Server challenge for authentication |
| 354 | Start mail input | Server is ready to accept the email data |
| 421 | Service unavailable | Server is temporarily unavailable |
| 450 | Mailbox unavailable | Requested action not taken (mailbox busy) |
| 452 | Insufficient storage | Server ran out of disk space |
| 500 | Syntax error | Command unrecognized or syntax error |
| 535 | Auth failed | Authentication credentials invalid |
| 550 | Mailbox not found | Requested action not taken (mailbox unavailable) |
| 552 | Over quota | Mailbox full - exceeded storage allocation |
| 553 | Invalid name | Mailbox name not allowed |
| 554 | Transaction failed | SMTP transaction or mailing failed |
Get started sending emails with these ready-to-use code snippets
1import smtplib2from email.mime.text import MIMEText3from email.mime.multipart import MIMEMultipart45# Create the email message6msg = MIMEMultipart()7msg['From'] = 'alice@example.com'8msg['To'] = 'bob@domain.com'9msg['Subject'] = 'Hello from SMTP!'1011# Add body text12body = "Hi Bob,\nThis email was sent via SMTP!\nBest, Alice"13msg.attach(MIMEText(body, 'plain'))1415# Connect and send via SMTP16with smtplib.SMTP('smtp.example.com', 587) as server:17 # Upgrade to TLS encryption18 server.starttls()19 20 # Authenticate21 server.login('alice@example.com', 'your-password')22 23 # Send the email24 server.sendmail(25 msg['From'],26 msg['To'],27 msg.as_string()28 )29 30 print("Email sent successfully!")Type real SMTP commands in a realistic terminal — the server responds just like the real thing. Need a refresher? Check the Commands section above!
💡 This is a simulated environment — no real emails are sent. Type HELP in the terminal or check the Commands section above for a full reference.