Learn the SMTP handshake process with this interactive command simulator. Walk through the complete HELO → MAIL FROM → RCPT TO → DATA → QUIT sequence, see real server responses, and reference every SMTP status code. This educational tool helps you understand how email delivery works at the protocol level.
Try: HELO mail.example.com, MAIL FROM:<user@example.com>, RCPT TO:<dest@example.com>, DATA, QUIT

SMTP (Simple Mail Transfer Protocol) is the standard protocol for sending email across the internet, defined in RFC 5321. When you click "Send" in your email client, your device connects to an SMTP server on port 25 (server-to-server) or port 587 (client-to-server submission) and exchanges a series of text commands to deliver the message.
SMTP works alongside other protocols: DNS resolves MX records to find the recipient's mail server, while protocols like IMAP and POP3 handle retrieving messages. If you've ever used our Port Checker to test mail server connectivity, you've already seen SMTP ports in action.
Every SMTP email delivery follows this exact sequence of commands and responses:
| Step | Client Command | Server Response | Purpose |
|---|---|---|---|
| 1 | (connect) | 220 server ready | TCP connection established |
| 2 | EHLO hostname | 250 + capabilities | Identify client, list features |
| 3 | STARTTLS | 220 ready for TLS | Upgrade to encrypted connection |
| 4 | AUTH LOGIN | 235 authenticated | Authenticate sender (submission only) |
| 5 | MAIL FROM:<sender> | 250 Ok | Specify envelope sender |
| 6 | RCPT TO:<recipient> | 250 Ok | Specify recipient(s) |
| 7 | DATA | 354 send data | Begin message body |
| 8 | message + "." | 250 queued | Deliver message content |
| 9 | QUIT | 221 Bye | Close connection |
Pro Tip: Use
EHLOinstead ofHELOin modern implementations. EHLO (Extended HELO) returns the server's supported extensions like STARTTLS, AUTH mechanisms, and maximum message size. If you need to test SMTP connectivity to a real server, first verify the port is open using our Port Checker on port 25 or 587.
SMTP responses always begin with a three-digit code. The first digit indicates the general category:
| Code | Meaning | Common Cause | Action |
|---|---|---|---|
| 220 | Service ready | Server greeting on connect | Proceed with EHLO |
| 221 | Closing connection | Response to QUIT | Normal termination |
| 235 | Authentication successful | Valid credentials provided | Proceed with MAIL FROM |
| 250 | Action completed | Command accepted successfully | Continue next command |
| 354 | Start mail input | Response to DATA command | Send message body |
| 421 | Service unavailable | Server overloaded/shutting down | Retry later |
| 450 | Mailbox unavailable | Greylisting, temporary block | Retry in 5-15 minutes |
| 451 | Local error | Server processing failure | Retry later |
| 452 | Insufficient storage | Recipient mailbox full | Contact recipient |
| 500 | Syntax error | Unrecognized command | Check command format |
| 501 | Parameter error | Invalid email address format | Fix the address |
| 503 | Bad sequence | Commands in wrong order | Follow proper sequence |
| 530 | Auth required | Server requires authentication | Send AUTH command first |
| 535 | Auth failed | Invalid username/password | Check credentials |
| 550 | Mailbox not found | Recipient doesn't exist | Verify address |
| 551 | User not local | Recipient on different server | Try forwarding address |
| 552 | Storage exceeded | Message too large | Reduce attachment size |
| 553 | Mailbox name invalid | Malformed email address | Correct the address |
| 554 | Transaction failed | Blacklisted, policy violation | Check sender reputation |
SMTP uses different ports depending on the type of connection. Understanding which port to use is critical for proper email configuration:
| Port | Protocol | Encryption | Use Case |
|---|---|---|---|
| 25 | SMTP | STARTTLS (optional) | Server-to-server delivery (MTA relay) |
| 465 | SMTPS | Implicit TLS | Client submission (legacy, re-standardized) |
| 587 | Submission | STARTTLS (required) | Client submission (recommended) |
| 2525 | SMTP (alt) | STARTTLS | Alternative when 25/587 blocked by ISP |
Many ISPs block outbound port 25 to prevent spam from compromised home computers. If you're running a mail server behind your router, you'll need to configure port forwarding and ensure your ISP allows SMTP traffic. Test port availability with our Port Checker.
You can test SMTP connectivity directly from your terminal. This is useful when troubleshooting email delivery issues on your network:
telnet smtp.example.com 25
EHLO myhost.example.com
MAIL FROM:<test@example.com>
RCPT TO:<user@example.com>
DATA
Subject: Test Message
This is a test.
.
QUIT
openssl s_client -starttls smtp -connect smtp.example.com:587
Before testing, make sure the target port is accessible. Use our Port Checker or a Ping Test to verify basic connectivity to the mail server. You may also want to check the server's MX record to confirm you're connecting to the right host.
When email delivery fails, the SMTP error code tells you exactly what went wrong. Here are the most common issues network administrators encounter:
SMTP (Simple Mail Transfer Protocol) is the internet standard for sending email. It works through a series of text commands exchanged between a client and server over a TCP connection. The client identifies itself, specifies the sender and recipient, transmits the message data, and closes the connection. Each command receives a numeric response code indicating success or failure.
Use port 587 with STARTTLS encryption for sending email from an email client (this is the recommended submission port). Port 465 with implicit TLS is also acceptable. Port 25 is used for server-to-server delivery and is often blocked by ISPs for residential connections to prevent spam.
SMTP error 550 means the recipient mailbox was not found or the server permanently rejected the message. Common causes include a non-existent email address, a full mailbox, or the sending IP being blacklisted. Check the full error message for the specific enhanced status code (like 5.1.1 for user not found).
You can test SMTP connectivity using telnet (telnet server 25) or OpenSSL for encrypted connections. Start by checking if the port is open using a port checker, then attempt the full SMTP handshake sequence: connect, EHLO, MAIL FROM, RCPT TO, and QUIT.
SMTP is used exclusively for sending email — it handles the delivery of messages from sender to recipient server. IMAP (Internet Message Access Protocol) is used for receiving and managing email — it lets your email client read, organize, and synchronize messages stored on the server. You need both protocols for a complete email experience.
SMTP connection refusals are commonly caused by: firewall rules blocking the port, ISP blocking outbound port 25, the server being down, incorrect hostname or port, or your IP being blacklisted. Start by using a Port Checker to verify the port is accessible, then check your DNS to confirm the correct mail server hostname.
About Tommy N.
Tommy is the founder of RouterHax and a network engineer with 10+ years of experience in home and enterprise networking. He specializes in router configuration, WiFi optimization, and network security. When not writing guides, he's testing the latest mesh WiFi systems and helping readers troubleshoot their home networks.
![]() |
![]() |
![]() |
![]() |
Promotion for FREE Gifts. Moreover, Free Items here. Disable Ad Blocker to get them all.
Once done, hit any button as below
![]() |
![]() |
![]() |
![]() |