If your emails aren't going out, the first thing to test is the SMTP connection itself. A 30-second check tells you whether the server is reachable, whether TLS is up, and whether your credentials work.

Pro tip: Always test from the same network and machine where your application sends mail. Firewalls, ISPs and cloud providers often block port 25 — but allow 587 and 465.

Quick test with telnet (port 587, no TLS)

  1. Open a terminal.
  2. Run: telnet your-smtp-host 587
  3. You should see a 220 greeting from the server.
  4. Type EHLO yourdomain.com — the server should reply with 250 capabilities.
  5. Type QUIT to close.

Test TLS with openssl (port 587 + STARTTLS)

  1. Run: openssl s_client -starttls smtp -crlf -connect your-smtp-host:587
  2. Check the certificate chain and verify return code 0 (ok).
  3. Type EHLO yourdomain.com to confirm authentication is offered.

Test full sending with swaks

Swaks is the fastest way to send a real test email:

  • swaks --to [email protected] --server smtp.host:587 --tls --auth LOGIN --auth-user you --auth-password ••••
  • Watch every step (greeting, EHLO, STARTTLS, AUTH, MAIL FROM, RCPT TO, DATA, .).

Common SMTP errors and what they mean

  • 421 — service not available, often rate-limit or IP block.
  • 535 — authentication failed, check user/password.
  • 550 — mailbox unavailable, recipient rejected.
  • Connection refused — firewall blocks the port or wrong host.
  • TLS handshake failed — incompatible TLS version or expired certificate.

Skip the SMTP headaches — use Mailpro

Mailpro's SMTP relay handles TLS, authentication, deliverability and reputation for you. Free trial, no credit card. Try Mailpro SMTP free · Deliverability hub

Related reading:

Previous question

   

Next question

You might also be interested in:

How to Fix Error 552 (Storage Limit Exceeded)

SMTP error 552 means the destination has refused the message because it exceeded a storage or size limit. Two distinct...

Read more

How to Fix Error 5.7.1 (Relay Access Denied)

Code 5.7.1 « Relay access denied » means the SMTP server you connected to refuses to forward your message to...

Read more

How to Fix Error 451 (Local Policy Violation or Greylisting)

SMTP error 451 is a soft bounce: the receiving server is asking to try again later. The two most common...

Read more

How to Fix Error 530 (Authentication Required)

SMTP error 530 means: I won’t accept your message until you log in. The server is asking for authentication and...

Read more

How to Solve Error 550 (Requested Action Not Taken – Mailbox Unavailable)?

SMTP code 550 is a hard bounce: the receiving server has refused the message. The text right after the code...

Read more