Smtp

SMTP error codes: what every reply code means and how to fix it

Short answer

SMTP error codes are three-digit replies from a mail server. Codes starting with 2 mean success, 3 means send more data, 4 is a temporary failure you should retry, and 5 is a permanent failure you should not retry. Most servers add an enhanced code such as 5.1.1 (no such user) or 5.7.1 (rejected by policy), defined in RFC 3463, which tells you the actual reason far more precisely than the first three digits.

Last checked 16 November 2026

An SMTP error code is the three-digit reply a mail server sends when something fails. The first digit tells you what to do: 4 means try again later, 5 means stop and fix something. Most servers also send an enhanced status code like 5.1.1 or 5.7.1, which says why. Read that second code first.

How to read an SMTP reply

A typical rejection looks like this:

550 5.1.1 The email account that you tried to reach does not exist.
  • 550 is the basic reply code from RFC 5321.
  • 5.1.1 is the enhanced status code from RFC 3463.
  • The text is free-form and varies by provider. It often includes a link to the provider’s help page.

The first digit

First digit Meaning What to do
2 Success Nothing
3 Intermediate, send more Continue (for example after DATA)
4 Temporary failure Retry later with backoff
5 Permanent failure Do not retry unchanged; fix the cause

The enhanced code

Enhanced codes have three parts: class.subject.detail. The class matches the first digit (2, 4 or 5). The subject is the useful part:

Subject Area Example
x.1.x Address problems 5.1.1 bad destination mailbox
x.2.x Mailbox problems 4.2.2 mailbox full
x.3.x Mail system problems 4.3.0 other mail system error
x.4.x Network and routing 4.4.1 no answer from host
x.5.x Protocol problems 5.5.1 invalid command
x.6.x Message content 5.6.0 other media error
x.7.x Security and policy 5.7.1 delivery not authorized

IANA keeps the full registry of enhanced codes, created by RFC 5248.

Common SMTP error codes list

Temporary (4xx): retry later

Code Meaning Common cause
421 Service not available, closing connection Server busy, rate limiting, or your IP is being throttled
421 4.7.0 Try again later Reputation or rate limit at Gmail and others
450 Mailbox unavailable (temporary) Greylisting, mailbox locked
451 Local error in processing Server-side issue, or greylisting
451 4.7.1 Deferred by policy Greylisting or temporary reputation hold
452 Insufficient storage Too many recipients in one transaction, or mailbox full
452 4.2.2 Mailbox full Recipient over quota
454 4.7.0 TLS not available or temporary auth failure Retry, check TLS settings

A mail server that gets a 4xx keeps the message in its queue and retries, typically for several days. If you see the same 4xx for hours, it is a permanent problem wearing a temporary code.

Permanent (5xx): fix before resending

Code Meaning Common cause
500, 501, 502 Syntax error or command not implemented Client bug, bad address syntax
503 5.5.1 Bad sequence of commands Sent MAIL before EHLO, or AUTH before STARTTLS
530 5.7.0 Authentication required Not logged in, or login needs TLS first
535 5.7.8 Authentication credentials invalid Wrong username, password or password type (RFC 4954)
538 5.7.11 Encryption required for this authentication method Turn on TLS
550 5.1.1 Mailbox does not exist Typo or deleted address
550 5.7.1 Rejected by policy Blocklist, spam filter, relay not allowed
550 5.7.26 Unauthenticated sender (Gmail) SPF and DKIM fail, or DMARC policy blocks it
552 5.2.2 Mailbox full Recipient over quota
552 5.3.4 Message too big Attachment over the receiver’s size limit
553 5.1.3 Bad address syntax Malformed address
554 5.7.1 Transaction failed, rejected Spam or policy rejection

The 550 family is the most common permanent error. The 550 error guide goes through each variant.

Errors you see when connecting or logging in

Some errors come from your SMTP library rather than the server:

“SMTP Error: Could not authenticate” is PHPMailer’s wording for a rejected login (usually a 535 underneath). Fix it by checking the username, using an app password or API key, and making sure SMTPSecure and Port match: ENCRYPTION_SMTPS with 465, ENCRYPTION_STARTTLS with 587. Turn on $mail->SMTPDebug = 2 to see the server’s actual reply.

“The SMTP server requires a secure connection or the client was not authenticated” comes from .NET’s SmtpClient and wraps a 530. See SMTP requires a secure connection.

Connection timed out has no code because no server answered. A firewall or your host is blocking the port, or you paired SSL with port 587 by mistake.

Bounce codes: soft vs hard

A bounce email quotes the code the receiving server gave. In practice:

  • Hard bounce: a 5xx address error, usually 5.1.x. Stop sending to that address.
  • Soft bounce: a 4xx, or a 5.2.2 mailbox full. Retry, and stop if it persists across several sends.
  • Policy block: a 5.7.x. The address is probably fine; the problem is your domain, IP or content.

Keeping hard bounces low matters. Providers watch bounce rates, and a high rate can get a sending account paused. The hard vs soft bounces guide has more.

How to debug any SMTP error

  1. Get the full reply. Turn on debug logging in your library, or read the bounce message’s diagnostic code.
  2. Read the enhanced code, not just the first three digits.
  3. Check the provider’s own page. Gmail and Microsoft publish their codes: Google’s SMTP errors and codes and Microsoft’s NDR reference.
  4. Decide: address, auth, or policy. 5.1.x is the address, 5.7.0 to 5.7.11 is your login, other 5.7.x is policy and reputation.

If you send through Mailcandor, each bounce arrives as an email.bounced webhook, and the deliverability coach explains the code in plain English with the likely fix. Our free email tools cover the DNS and header checks that most 5.7.x fixes need.

Questions

What is an SMTP error?

It is the reply a mail server sends when it refuses a command or a message. The reply starts with a three-digit code, often followed by an enhanced code like 5.7.1 and a human-readable reason.

What is the difference between 4xx and 5xx SMTP errors?

4xx errors are temporary: the server wants you to try again later, and mail servers retry automatically. 5xx errors are permanent: retrying the same message will fail the same way until you change something.

What does 'SMTP Error: Could not authenticate' mean?

It is PHPMailer's message when the server rejects the login. Check the username, use an app password or API key instead of an account password, and make sure TLS is on before authenticating.

Is a bounce code the same as an SMTP error code?

Yes. A bounce message (non-delivery report) quotes the SMTP reply the receiving server gave, so the same 4xx and 5xx codes and enhanced codes apply.

Should I remove an address after a 5xx error?

After 5.1.1 (user unknown) and similar address errors, yes: add it to your suppression list. After policy errors like 5.7.1, the address is probably fine and the problem is your sending setup or reputation.

Related

Send with someone on your side.

Unlimited domains on every plan, a person before any block, and 3,000 emails a month free. Tell us what you send and we set you up within one business day.