Skip to content

SMTP Test: How to Check Your Mail Server Step by Step

Run an SMTP test in five steps: DNS, ports, TLS, login and a real message. Includes commands, common error codes and fixes.

Nov 16, 2026 5 min read 1,129 words
SMTP Test: How to Check Your Mail Server Step by Step
SMTP test: how to check your mail server step by step
SMTP test: how to check your mail server step by step

An SMTP test tells you whether a mail server can accept and send messages. You run one when a new mailbox will not send, when a campaign tool cannot connect, or when mail leaves your server and never arrives.

The good news is that most failures fall into a short list: wrong port, wrong encryption mode, bad login or a DNS gap. This guide walks through a five-step SMTP test, with commands, the reply codes you will meet, and the fix for each failure.

What an SMTP test checks#

SMTP is the protocol that moves email between servers. A full test looks at five things:

  1. DNS: Does the domain have mail records, and do they point at a live server?
  2. Connection: Can your machine reach the server on the right port?
  3. Encryption: Does the server offer TLS, and is its certificate valid?
  4. Authentication: Does the login work?
  5. Delivery: Does a real message go through?

Run them in this order. A failure at step one makes the rest pointless, so you save time by going from the cheapest check to the most involved.

Step 1: Check DNS first#

Before you test the server, test the records around it. Look up the domain's MX record to see where mail goes:

dig MX example.com +short

If nothing comes back, the domain cannot receive mail. Also check the SPF, DKIM and DMARC records, because receiving servers use them to judge your mail. Tomba's SPF checker reads the SPF record for you. For a broader view, Tomba's SMTP tester takes a domain and reviews its MX records, the server handshake, SPF, DKIM and DMARC, STARTTLS and the common ports.

Step 2: Check the port#

Servers listen on different ports for different jobs.

Port Used for Encryption
25 Server-to-server delivery Usually STARTTLS, if offered
587 Mail submission from clients and apps STARTTLS
465 Mail submission over TLS Implicit TLS, from the first byte

Many internet providers and cloud hosts block outbound port 25, so apps usually send through 587 or 465. RFC 8314 registered port 465 for submission over TLS and recommends implicit TLS. Your provider's documentation tells you which one to use.

Test that a port is open:

nc -vz smtp.example.com 587

If the connection times out, a firewall or your host is blocking it. No SMTP test can pass until that is fixed.

Step 3: Check TLS#

Use openssl to see the handshake. For port 587, which starts plain and upgrades:

openssl s_client -starttls smtp -connect smtp.example.com:587

For port 465, which uses TLS from the start:

openssl s_client -connect smtp.example.com:465

Read the output for three things: the certificate dates, whether the host name matches, and the TLS version. An expired certificate or a name mismatch makes many mail clients refuse the connection.

A frequent mistake is mixing the modes. If you point an app at port 465 but set it to STARTTLS, it hangs. Match the setting to the port.

Step 4: Check authentication#

Most servers need a login before they accept outgoing mail. Your app sends a username and password after the TLS step. If the login fails, the server answers with a 535 code.

Do not paste real passwords into a shared terminal or a ticket. Use a test mailbox when you can, and use an app password where your provider supports it.

Common causes of a failed login:

  • The username must be the full address, not just the name.
  • Two-step sign-in is on, and an app password is required.
  • The provider turned off basic sign-in for that account.
  • The account is locked after too many tries.

Step 5: Send a real test message#

The last step proves the whole chain. Send a plain message from the account to a mailbox you control, ideally at a different provider. Then look at three things:

  • Did it arrive, and how long did it take?
  • Did it land in the inbox or in spam?
  • In "show original" or "view headers", do SPF, DKIM and DMARC show a pass?

If mail arrives but goes to spam, the server works and the problem is reputation or authentication. That is a deliverability job, not a connection job.

SMTP reply codes you will see#

Servers answer each command with a three-digit code. The first digit tells you the class.

Code Meaning What to do
220 Server is ready Nothing, this is the greeting
250 Command accepted Nothing, this is success
421 Service not available, try later Wait and retry, check server load
450 / 451 Temporary mailbox or local problem Retry later, the server may be throttling
535 Login failed Check username, password and app password
550 Mailbox unavailable or message refused Read the text, it often says why
554 Transaction failed Often a policy or spam block, read the details

Codes that start with 4 are temporary, and the sender retries. Codes that start with 5 are permanent, and the sender stops. Always read the text after the code, because it usually names the cause.

A quick fix list#

Symptom Likely cause Fix
Connection times out Port blocked Try 587 or 465, ask your host
Hangs after connect Wrong TLS mode Match STARTTLS or implicit TLS to the port
Certificate error Name mismatch or expired cert Use the host name on the certificate
535 error Bad login Reset the password, use an app password
Sends but lands in spam Weak authentication or reputation Fix SPF, DKIM and DMARC, then warm up

After the SMTP test: protect your list#

A working server only helps if you send to real addresses. Bounces hurt your reputation, so verify addresses before a campaign with an email verifier, and clean big lists with bulk tasks. For a new sending domain, build volume slowly with a warmup plan.

FAQ#

What is an SMTP test?#

It is a set of checks that show whether a mail server can accept your connection, secure it, log you in and deliver a message.

Which SMTP port should I use?#

Use the one your provider documents. For app and client sending, that is usually 587 with STARTTLS or 465 with implicit TLS. Port 25 is mostly for server-to-server delivery.

Why does my SMTP test time out?#

The port is probably blocked by a firewall or your host. Try another port or ask your provider to unblock it.

How do I test SMTP without sending mail?#

Use nc to check the port and openssl s_client to check TLS. Both stop before any message is sent.

Does a passing SMTP test mean my emails reach the inbox?#

No. It shows the server works. Inbox placement depends on authentication, reputation and content.

// start free

See who Tomba finds at any company

Type a company's domain to see its people, their roles and verified work emails, each with the pages it was found on. Free account, no card.

Free plan · No credit card required · GDPR & CCPA

Share
0 clapsEnjoyed it? Give a clap.
AU

// about the author

Tomba Editorial Team

Was this helpful?