How do I test an SMTP server?
Reviewed by Prabath Thalangama · Last updated
Connect to it the way your application would, negotiate TLS, log in and send a message, then read every server reply. This SMTP test does exactly that against the host and port you enter, with STARTTLS, implicit TLS or no encryption, and shows the full protocol log so you can see which step fails.
The connection is made from our servers, with a 15-second timeout. TLS certificates are verified strictly, the same way a well-behaved client verifies them, so an expired, self-signed or wrong-hostname certificate fails the test even if your own mail client was told to ignore it.
The message has a fixed subject and body; this is a connection and authentication check, not a way to send arbitrary mail. Private and internal addresses are refused, so it can only test servers reachable from the internet.
How do I run the SMTP test?
- Enter the SMTP host and port, and choose the TLS mode your provider documents: STARTTLS for 587, implicit TLS for 465.
- Add a username and password if the server requires authentication. Leave them empty to test an open or IP-restricted relay.
- Enter the sender and recipient addresses for the test message.
- Run the test and read the log from the top. The last lines show the step that failed and the server's reply code.
How to read the results
- Success / failure
- Success means the server accepted the message for delivery (a 250 reply to DATA). It does not prove the message reached the inbox.
- Protocol log
- Every command we sent and every reply the server gave: the greeting, EHLO capabilities (look for STARTTLS and AUTH), the TLS step, MAIL FROM, RCPT TO and DATA. The login exchange itself is hidden so your credentials never appear in the log.
- Reply codes
- 2xx is success, 4xx is a temporary failure worth retrying, 5xx is a permanent rejection. The text after the code usually names the reason.
Common SMTP errors and how to fix them
Connection timed out
A firewall is dropping the connection, or nothing listens on that port. Check the port, the server's firewall, and whether your provider blocks it; many networks block outbound port 25.
535 Authentication credentials invalid
Wrong username or password, or the account needs an app password because two-factor authentication is on. Some providers also require SMTP AUTH to be enabled per mailbox.
535 5.7.8 Username and Password not acceptedCERTIFICATE_VERIFY_FAILED
The server's certificate is self-signed, expired, missing an intermediate, or doesn't match the host name you entered. Install a certificate from a public CA that covers the exact host name.
554 Relay access denied
The server won't deliver to that recipient for an unauthenticated sender. Log in, and make sure the From address is one the account is allowed to send as.
STARTTLS extension not supported by server
The server doesn't offer STARTTLS on this port. Use implicit TLS on 465 if it supports it, or enable STARTTLS on the server.
Examples and command-line equivalents
Test STARTTLS on port 587 with OpenSSL
Type EHLO test after connecting to see the capabilities offered over TLS.
openssl s_client -starttls smtp -connect smtp.example.com:587 -crlf -quietTest implicit TLS on port 465
openssl s_client -connect smtp.example.com:465 -crlf -quietSend an authenticated test with swaks
swaks --server smtp.example.com:587 --tls --auth-user [email protected] \
--from [email protected] --to [email protected]Frequently asked questions
Which SMTP port should I use: 25, 465 or 587?
Use 587 with STARTTLS for submitting mail from applications and clients; it is the standard submission port. Port 465 with implicit TLS is also widely supported. Port 25 is for server-to-server relay and is blocked outbound by most cloud and residential networks.
Are my SMTP credentials stored or shown in the log?
No. They are used for the single test connection, never saved, and the login step is left out of the protocol log. For extra safety, test with an app password or a dedicated account.
Why does the test pass but my mail still bounces?
This test only proves the server accepted the message. Delivery to the final mailbox can still fail on SPF, DKIM, DMARC or reputation. Use the deliverability test to check those.
Further reading
- Postfix as a Null Client: Send-Only Mail Done Right
- Postfix as a Relay, with Milters
- Dovecot IMAP Basics
- RFC 5321: Simple Mail Transfer Protocol
- RFC 3207: SMTP Service Extension for Secure SMTP over TLS (STARTTLS)
- RFC 8314: Cleartext Considered Obsolete (implicit TLS on 465)
- Run a full Super Scan to check DNS, email, website and TLS for a domain at once.