What Is SMTP and How Does It Work?
SMTP (Simple Mail Transfer Protocol) is the standard protocol for sending email. When you click "Send," your email client connects to an SMTP server, authenticates your identity, and transmits the message. The server then routes the email to the recipient's mail server using DNS MX records.
The SMTP conversation follows a structured sequence: the server sends a greeting (220), the client identifies itself (EHLO), they negotiate encryption (STARTTLS), authenticate if needed (AUTH), specify the sender (MAIL FROM) and recipient (RCPT TO), transmit the message body (DATA), and close the connection (QUIT). Each step produces a three-digit response code that indicates success or failure.
Common SMTP Ports and When to Use Them
SMTP uses different ports for different purposes. Port 587 is the standard for email submission from clients — it uses STARTTLS to upgrade a plain-text connection to encrypted. Port 465 uses implicit SSL/TLS where the connection is encrypted from the first byte. Port 25 is the original SMTP port for server-to-server relay, but many ISPs block it to prevent spam. Port 2525 is an unofficial alternative when other ports are blocked.
For most applications, start with port 587 and STARTTLS. If that fails, try port 465 with SSL/TLS. Only use port 25 for server-to-server relay, and port 2525 as a last resort.
How to Test Your SMTP Server
Testing your SMTP server verifies that your email infrastructure is working correctly. Enter your server hostname (like smtp.gmail.com or smtp.office365.com), select the appropriate port, and choose the security mode. Our tool will establish a connection, perform the full SMTP handshake, and show you exactly what happens at each step.
The conversation log shows the raw SMTP dialogue — client commands in green, server responses in blue. This makes it easy to pinpoint where a connection fails. You can also add from and to email addresses to test the MAIL FROM and RCPT TO commands without actually sending an email.
Common SMTP Error Codes and What They Mean
SMTP uses three-digit reply codes grouped by category. 2xx codes indicate success: 220 (server ready), 250 (OK), 235 (authenticated). 4xx codes are temporary failures that may resolve on retry: 421 (service unavailable), 450 (mailbox busy), 451 (processing error). 5xx codes are permanent failures: 530 (authentication required), 535 (auth failed), 550 (mailbox not found), 554 (transaction failed).
When troubleshooting, pay attention to the specific code. A 535 means your credentials are wrong. A 550 means the recipient address does not exist. A 421 usually means the server is overloaded or you have been rate-limited.
STARTTLS vs SSL/TLS: What's the Difference?
STARTTLS (port 587) starts as a plain-text connection and upgrades to TLS after the initial handshake. The client sends a STARTTLS command, and if the server supports it, both sides negotiate encryption before continuing. Implicit SSL/TLS (port 465) encrypts the connection from the very first byte — there is no plain-text phase.
Both methods provide the same level of encryption once established. STARTTLS on port 587 is the current standard recommended by RFC 8314, but implicit TLS on port 465 has been re-recognized and is equally secure. The key difference is compatibility: some older systems only support one or the other.
SMTP Authentication Methods Explained
SMTP servers advertise supported authentication methods in their EHLO response. PLAIN sends credentials encoded in base64 (safe only over TLS). LOGIN is similar but uses a two-step challenge-response. XOAUTH2 uses OAuth 2.0 tokens and is the preferred method for Gmail and Microsoft 365.
Always ensure your connection is encrypted (via STARTTLS or SSL/TLS) before authenticating. Sending credentials over an unencrypted connection exposes them to interception. Most modern SMTP servers will reject AUTH attempts on unencrypted connections.