Start with a live test
Most SMTP problems show up as a vague “could not send” in the app. Before changing settings, run the same connection outside the app with the SMTP test. It stops at the step that fails (connect, encryption, login or send) and shows the server’s exact reply. Then jump to the matching section here.
Connection timed out or refused
What it means: the app never got an answer from the mail server. This happens before any SMTP command, so there is no error code.
- Port blocked on your side. AWS, Azure, Google Cloud, DigitalOcean and most home ISPs block outbound port 25. Many shared hosts also block 587 and 465 to stop spam. Switch to 587, then 465, then 2525.
- Wrong hostname. The SMTP server is usually
smtp.provider.comormail.yourdomain.com, not your website address. - Server only accepts local connections. Some hosting mail servers refuse logins from outside their own network.
- Firewall on the server. If you run the mail server, check that the port is open in the firewall and that the service is listening.
Check it: the SMTP port checker tests all four ports from our server. If a port is open there but times out from your app, the block is on your network or host.
TLS, SSL and certificate errors
Typical messages: wrong version number, SSL routines, handshake failure, certificate verify failed.
- Port and encryption don’t match. This is the most common cause. Port 465 needs SSL/TLS from the start; port 587 needs STARTTLS. “Wrong version number” nearly always means SSL was used on a STARTTLS port.
- Hostname doesn’t match the certificate. On shared hosting, connect with the host’s server name (for example
server123.host.com) rather thanmail.yourdomain.com. - Expired or self-signed certificate on a self-hosted server. Renew it, or install a free Let’s Encrypt certificate, then restart Postfix or Exim.
- Old TLS only. Modern libraries refuse TLS 1.0 and 1.1. The server needs TLS 1.2 or 1.3.
The SMTP test shows the certificate’s issuer, expiry and hostname match for every successful TLS connection.
Authentication failed (535)
535 5.7.8 Username and Password not accepted or 535 Authentication failed means the server reached the login step and rejected the credentials.
- App password needed. Gmail, Yahoo, iCloud, AOL and Zoho (with two-factor on) reject your normal password. See how to create an app password.
- Outlook.com, Hotmail and Live accounts no longer accept any password over SMTP. They need an app that signs in with OAuth 2.0.
- Microsoft 365 needs Authenticated SMTP enabled on the mailbox, and password-based SMTP is switched off by default from the end of December 2026.
- Wrong username format. Use the full email address. SendGrid is the exception: the username is the word
apikey. - Copied spaces. App passwords are often displayed in groups of four. Paste them without spaces if the app doesn’t strip them.
530: must issue STARTTLS first
530 5.7.0 Must issue a STARTTLS command first means the app tried to log in over an unencrypted connection. Set encryption to STARTTLS (port 587) or SSL/TLS (port 465). A plain 530 Authentication required means the server wants a login before it will accept mail: turn on SMTP authentication in the app.
Relay denied and sender rejected (550, 553)
550 5.7.1 Relaying denied: the server won’t forward mail for you because the session isn’t logged in. Enable authentication.550 5.7.60/553 Sender not allowed: the From address doesn’t match the account you logged in with. Use your own address, or add the other address as a verified sender or alias with the provider.
Blocked as spam (554, 550 5.7.x)
Replies that mention a blocklist (spamhaus, barracuda), “policy” or “reputation” mean the receiving server doesn’t trust your sending IP or domain.
- Run a blacklist check on your sending IP and domain.
- Check SPF, DKIM and DMARC. Missing or failing records are a common reason for 550 5.7.26 and similar rejections from Gmail and Yahoo.
- Read the full guide: why emails go to spam.
Temporary errors and throttling (421, 450, 451, 452)
4xx replies are temporary. The sending server should retry automatically.
- 421 / 451 with “try again later”: rate limiting or greylisting. Retries normally succeed within minutes.
- 452 / 4.5.3 too many recipients: split the message into smaller batches.
- Daily sending limits: Gmail allows about 500 messages a day for free accounts and Outlook.com about 300. Above that, use a sending service.
If the same 4xx keeps coming back for hours, treat it as permanent and look for the underlying cause.
Sent successfully but never arrived
A 250 OK after the message means the server accepted it. If it still doesn’t show up:
- Check the recipient’s spam and quarantine folders.
- Check the recipient domain’s MX records. A typo in the domain or missing MX means nowhere to deliver.
- Look for a bounce message in the sending mailbox. It contains the real reason.
- If the message did arrive late, paste its headers into the header analyzer to see which hop was slow.
Frequently asked questions
A timeout means nothing answered on that port. Usually your hosting provider, cloud platform or ISP blocks outbound SMTP (especially port 25), or the hostname is wrong. Try ports 587, 465 and 2525, and use the port checker to see which ones the server answers on.
Your app tried to start an SSL/TLS connection on a port that expects plain text followed by STARTTLS (usually 587). Set the encryption to STARTTLS for port 587, or use port 465 with SSL/TLS.
The usual reasons are: two-step verification was turned on (the old password stops working for SMTP), the provider retired password logins (Outlook.com in 2024, Microsoft 365 from December 2026), the password was changed, or your host started blocking an outbound port.