SMTP Test Tool

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.

SMTP Command Simulator

Try: HELO mail.example.com, MAIL FROM:<user@example.com>, RCPT TO:<dest@example.com>, DATA, QUIT

SMTP Test Tool
Figure 1 — SMTP Test Tool

What Is SMTP?

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.

The SMTP Handshake Sequence

Every SMTP email delivery follows this exact sequence of commands and responses:

StepClient CommandServer ResponsePurpose
1(connect)220 server readyTCP connection established
2EHLO hostname250 + capabilitiesIdentify client, list features
3STARTTLS220 ready for TLSUpgrade to encrypted connection
4AUTH LOGIN235 authenticatedAuthenticate sender (submission only)
5MAIL FROM:<sender>250 OkSpecify envelope sender
6RCPT TO:<recipient>250 OkSpecify recipient(s)
7DATA354 send dataBegin message body
8message + "."250 queuedDeliver message content
9QUIT221 ByeClose connection

Pro Tip: Use EHLO instead of HELO in 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 Status Codes Reference

SMTP responses always begin with a three-digit code. The first digit indicates the general category:

CodeMeaningCommon CauseAction
220Service readyServer greeting on connectProceed with EHLO
221Closing connectionResponse to QUITNormal termination
235Authentication successfulValid credentials providedProceed with MAIL FROM
250Action completedCommand accepted successfullyContinue next command
354Start mail inputResponse to DATA commandSend message body
421Service unavailableServer overloaded/shutting downRetry later
450Mailbox unavailableGreylisting, temporary blockRetry in 5-15 minutes
451Local errorServer processing failureRetry later
452Insufficient storageRecipient mailbox fullContact recipient
500Syntax errorUnrecognized commandCheck command format
501Parameter errorInvalid email address formatFix the address
503Bad sequenceCommands in wrong orderFollow proper sequence
530Auth requiredServer requires authenticationSend AUTH command first
535Auth failedInvalid username/passwordCheck credentials
550Mailbox not foundRecipient doesn't existVerify address
551User not localRecipient on different serverTry forwarding address
552Storage exceededMessage too largeReduce attachment size
553Mailbox name invalidMalformed email addressCorrect the address
554Transaction failedBlacklisted, policy violationCheck sender reputation

SMTP Ports and Security

SMTP uses different ports depending on the type of connection. Understanding which port to use is critical for proper email configuration:

PortProtocolEncryptionUse Case
25SMTPSTARTTLS (optional)Server-to-server delivery (MTA relay)
465SMTPSImplicit TLSClient submission (legacy, re-standardized)
587SubmissionSTARTTLS (required)Client submission (recommended)
2525SMTP (alt)STARTTLSAlternative 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.

Note: Always use encrypted connections (STARTTLS on port 587 or implicit TLS on port 465) for client email submission. Sending credentials over unencrypted port 25 exposes your username and password to anyone monitoring the network. Check your DNS records to verify MX configuration and ensure your mail server uses proper TLS certificates — you can verify this with our SSL Certificate Checker.

Testing SMTP from the Command Line

You can test SMTP connectivity directly from your terminal. This is useful when troubleshooting email delivery issues on your network:

Using Telnet

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

Using OpenSSL (for TLS)

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.

Common SMTP Errors and Fixes

When email delivery fails, the SMTP error code tells you exactly what went wrong. Here are the most common issues network administrators encounter:

  • 550 5.1.1 Recipient rejected — The email address doesn't exist. Verify the address and check for typos.
  • 554 5.7.1 Rejected by policy — Your sending IP is blacklisted or fails authentication. Check your IP with an IP Blacklist Checker.
  • 450 4.7.1 Greylisted — The server is temporarily rejecting your message. Retry in 5-15 minutes; legitimate mail servers will retry automatically.
  • 421 Connection timed out — The server is overloaded or your connection dropped. Check your bandwidth and network latency.
  • 530 Authentication required — The server requires login before sending. Ensure your email client is configured with valid SMTP credentials.
Key Takeaways
  • SMTP uses a simple text-based command/response protocol for sending email.
  • The standard sequence is EHLO → MAIL FROM → RCPT TO → DATA → QUIT.
  • Use port 587 with STARTTLS for client email submission — never send credentials over port 25.
  • SMTP response codes starting with 2xx indicate success, 4xx are temporary failures (retry), and 5xx are permanent errors.
  • Test mail server connectivity with our Port Checker on ports 25, 465, and 587.
  • Always configure SPF, DKIM, and DMARC to improve deliverability and prevent spoofing.

Video: SMTP Protocol Explained

Related Tools and Guides

Frequently Asked Questions

What is SMTP and how does it work?

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.

What port should I use for SMTP?

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.

What does SMTP error 550 mean?

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).

How do I test if an SMTP server is working?

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.

What is the difference between SMTP and IMAP?

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.

Why is my SMTP connection being refused?

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