SMTP guide

SMTP errors 554, 535 and TLS: causes and fixes

Every server reply tells you what went wrong: authentication, sender, encryption or limits. Learn to read them and fix the most common ones without guessing.

How to read an SMTP reply

When an SMTP server rejects something, it replies with a three-digit code, an enhanced status code and a text. For example: 535 5.7.8 Error: authentication failed.

The first digit gives the type of reply: 2 means everything went fine, 4 is a temporary error (you can try again later) and 5 is a permanent error (repeating the send won't fix it: something has to change). The enhanced code (RFC 3463) and the text pin down the reason, and they're usually the most useful part for diagnosis.

Short answer

Find the full reply in your plugin's or application's log. A 535 means a wrong username or password; a 554 means the server won't accept the send (no authentication, a sender that isn't on your verified domain or a restriction on the account); a 530 or a handshake failure means the wrong port and encryption pair; and a 451 is a temporary limit.

Types

Temporary and permanent errors

ReplyTypeWhat to do
2xxSuccessNothing: the server accepted the command or the message.
4xxTemporaryTry again after a while. A mail server retries on its own; an application or a plugin usually doesn't, so you'll have to resend it.
5xxPermanentDon't just retry: read the text, fix the cause and send again.

An email can be accepted (250) and bounce later, when the recipient's server rejects it. Those bounces are handled differently: we explain them in the hard and soft bounce guide.

554 Access denied

554 Relay access denied or Access denied

It means the server won't relay your message: it doesn't know who you are or won't let you send through it. It's almost always one of these:

  • The application doesn't authenticate: SMTP AUTH with a username and password needs to be turned on.
  • On port 587, authentication is attempted without STARTTLS and the server doesn't accept it.
  • The application connects to another server (your host's, for example) instead of the one you set up. It happens when the SMTP plugin isn't active or another plugin overrides its settings.

Mailiqo replies 554 5.7.1 … Client host rejected: Access denied when the client tries to send without authenticating. The classic Relay access denied comes from other servers: if you see it, your application most likely isn't connecting to smtpmq.mailiqo.com.

554 Data rejected

554 Data command rejected: Mailiqo rejects the send

Mailiqo checks every send before accepting it. If something doesn't add up, it replies with 554 5.7.1 and the reason after Data command rejected, for example: 554 5.7.1 <DATA>: Data command rejected: domain not verified.

ReasonWhat it meansWhat to do
sender domain not allowedThe sender's domain isn't on your account. It must match exactly: a subdomain isn't covered by its parent domain.Send from a domain in Email → Domains or add the one you use.
domain not verifiedThe domain has been added, but its DNS records aren't verified.Finish the DNS setup and click Refresh status.
sender not allowedThe domain only accepts certain addresses (Allowed senders).Send from an allowed address or update the list.
ip not allowed / ip blockedThe IP you're sending from isn't among the domain's Allowed IPs, or it's in its Blocked IPs.Send from another IP or update the domain's lists.
account not active / no creditsThe account or subscription isn't active, or the sending quota is used up.Check Settings → Plan and usage.
rate exceededToo many messages in the same minute.Wait a minute and send again.
message too largeThe message exceeds your account's maximum size.Shrink or remove attachments.
unknown client / missing smtp authThe username doesn't exist or the client didn't authenticate.Copy the domain's credentials again and turn on authentication.

Messages whose content is classified as spam can also be rejected with a 5xx reply and a different text.

535

535 5.7.8: authentication failed

The server rejected the username or password. The usual causes:

  • A mistyped username or password, often with a space at the start or end.
  • The dashboard login password or an API key is used instead of the SMTP credentials.
  • The credentials were regenerated and the application still has the old ones.
  • The plugin reads the password from wp-config.php (a constant) or an environment variable that still holds the old value.
  • With personal mailboxes, some providers require an app password or OAuth instead of the normal password.

At Mailiqo, SMTP credentials are under Email → Domains, for each domain, and they're different from the API key. The password is only shown once: if you don't have it, regenerate the credentials and update every application that uses them, because the old ones stop working immediately.

TLS

TLS and encryption errors

Encryption has to match the port: 587 goes with STARTTLS (labelled TLS in many programs) and 465 with implicit TLS (SSL or SSL/TLS).

SymptomCauseFix
530 5.7.0 Must issue a STARTTLS command firstConnecting to 587 without encryptionChoose TLS or STARTTLS
wrong version number or handshake failureSSL on 587 or STARTTLS on 465Use 587 with STARTTLS or 465 with SSL
Certificate errorThe server name doesn't match the certificate, or the system has outdated root certificatesUse the server's exact name (not an IP) and update the system's certificates
The connection hangsA firewall drops the connection or the port and encryption pair is wrongTest the port with openssl and try the other one

Don't turn off certificate verification to get past an error: it leaves the connection exposed and the problem is still there.

Connection

Connection refused or timed out

  • Connection refused: nothing answers on that server and port. Check the server name and the port.
  • Connection timed out: a firewall is dropping the connection. Many hosts and clouds block outbound SMTP ports: try the other port or ask for it to be opened.
  • If there's no way to open 587 or 465, send through an API over HTTPS.
openssl s_client -starttls smtp -connect smtpmq.mailiqo.com:587 -servername smtpmq.mailiqo.com
451, 452, 552

Limits and size: 451, 452 and 552

ReplyWhat it meansWhat to do
451 4.7.1An hourly or daily sending limit has been reachedIt's temporary: send again later. If you need more volume, contact support.
450 4.7.1 internal error, please retryThe server couldn't check the send at that momentSend it again in a few minutes.
452 4.5.3 Error: too many recipientsMore recipients than allowed in a single message (50 at Mailiqo)Split the send into several messages.
552 5.3.4 Message size exceeds fixed limitThe message is too large (over 50 MiB at Mailiqo)Shrink the attachments or link to them.

At Mailiqo, hourly and daily limits rise automatically as the account sends without problems, and SMTP and API sends count together.

Checklist

A checklist for any SMTP error

  1. 1Copy the server's full reply from the plugin's or application's log, not just the code.
  2. 2Look at the first digit: 4 is temporary; 5 needs fixing.
  3. 3Check the server, port and encryption: 587 with STARTTLS or 465 with SSL.
  4. 4Check that authentication is on and that the credentials are the domain's SMTP ones.
  5. 5Check that the sender is on a verified domain, with an exact match.
  6. 6If it still fails, look for the send in your service's log and, if needed, open a ticket with the full reply and the time of the attempt.
FAQ

Frequently asked questions

Does a 554 error mean my domain is blacklisted?

Not necessarily. 554 is a generic permanent rejection: the reason is in the text that comes with it. It's almost always missing authentication, a sender that isn't on your domain or a restriction on the account.

Should I retry a 5xx error?

Not without changing something: the server will reject it again. Fix the cause (credentials, sender, encryption) and then send again. 4xx errors can be retried after a while.

Where do I see the server's full reply?

In your SMTP plugin's email log or your application's logs. At Mailiqo, Email → Logs also shows sends rejected over SMTP with their reason when you filter by the SMTP channel.

It used to work and now I get 535. What happened?

Most likely someone regenerated the SMTP credentials or changed the password in the application. Copy them again from the dashboard and update them everywhere they're used.

What's the difference between an SMTP error and a bounce?

Your application gets the SMTP error while sending: the message wasn't accepted. A bounce comes later: the message was accepted, but the recipient's server couldn't deliver it.

Mailiqo

Clear errors and a log of every send

With Mailiqo you see every send in the dashboard, with its status and the server's reply when something fails. Start free, no card required.

Create a free account
Mailiqo Labs

Put the guide into practice

The tools let you check SPF, DMARC, headers, bounces and HTML with your own data, without registering.