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
- Get the full reply. Turn on debug logging in your library, or read the bounce message’s diagnostic code.
- Read the enhanced code, not just the first three digits.
- Check the provider’s own page. Gmail and Microsoft publish their codes: Google’s SMTP errors and codes and Microsoft’s NDR reference.
- 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.