SMTP

SMTP Error 540

SMTP Error 540 isn't a standard RFC 5321 code. Learn what it actually means (enhanced status 5.4.0 or a provider rejection like Rambler) and how to fix the bounce.

Updated Jul 1, 2026

The short answer

"SMTP Error 540" is not a standard SMTP reply code — RFC 5321 defines no 540 basic code. In practice it's either a misread enhanced status code 5.4.0 ("other/undefined network or routing failure," RFC 3463) or a provider-specific permanent rejection (e.g., Rambler returns "540 recipient address rejected: Inactive/Blocked"). Treat it as a 5xx permanent bounce: verify the recipient address, then check why the receiving server is blocking you.

Is "SMTP Error 540" a real SMTP code?

Not in the standard sense. RFC 5321 §4.2.1 defines the SMTP reply-code registry, and 540 is not one of the defined three-digit basic reply codes — the permanent (5yz) codes that exist are 500–504, 521/523/524, 530–538, 550–557, etc. (Wikipedia's RFC 5321 list has no 540 entry.) So when you see "540," it is almost always one of two things:

  1. A misread enhanced status code 5.4.0. Under RFC 3463 §3.5, X.4.0 means "Other or undefined network or routing status" — "something went wrong with networking, but it is not clear what the problem is." The leading 5 makes it permanent. Stripping the dots turns 5.4.0 into the "540" some tools and logs display.
  2. A provider-specific literal 540 rejection. Some mail servers reuse the number for a permanent recipient rejection. For example, SMTP Field Manual documents Rambler returning 540 recipient address rejected: Inactive or ... Blocked — i.e., a suspended/deactivated mailbox or a sender that's been blocked.

Either way, the leading 5 tells you this is a permanent failure — do not blindly retry (RFC 5321 §4.2.1).

How do I fix SMTP Error 540?

Because the code is non-standard, read the full bounce text — the human-readable part after the number is the real diagnostic. Then work through these in order:

  1. Verify the recipient address. If the text says "Inactive," "Blocked," "no such user," or "mailbox unavailable," the address is likely dead or suspended. Confirm spelling, remove it from your list, and reach the contact through another channel. Sending more mail to it will keep bouncing and hurt your sender reputation.
  2. Confirm it's permanent vs. transient. A genuine 5.4.0 (network/routing) sometimes masks a transient routing problem on the receiving side. If the wording is vague, you can retry once after a delay; if it persists, treat it as permanent and stop.
  3. Check why you're being blocked (sender-side). If the rejection is reputation/policy-based, authenticate your mail so receivers trust you:
  4. SPF — publish a record authorizing your sending IPs (RFC 7208).
  5. DKIM — sign your messages (RFC 6376).
  6. DMARC — align and publish a policy (RFC 9989, which obsoletes the earlier RFC 7489).
  7. Check your sending IP/domain against major blocklists and request delisting if listed.
  8. Look up the code in your provider's docs. Whatever generated the "540" (your ESP, an appliance like Mimecast, or the receiving server) is the source of truth. The number alone is ambiguous; the provider's message defines it.

Quick reference

  • 540 ... Inactive / Blocked (e.g., Rambler) — Most likely meaning: Recipient mailbox suspended/deactivated or sender blocked; Action: Verify/remove address; check sender reputation
  • Tool shows 5.4.0 — Most likely meaning: RFC 3463 "other/undefined network or routing" failure; Action: Inspect routing/DNS; retry once, then treat as permanent
  • Vague "540" with no text — Most likely meaning: Implementation-specific; Action: Consult the emitting server's/provider's docs

Note: RFC 5321 §4.2.1 actually discourages servers from inventing new reply codes rather than reusing the ones already defined — but in practice, some legacy or non-compliant mail systems assign their own meanings to unused numbers like 540 anyway, which is why the code isn't reliable across providers. Always trust the accompanying text over the bare number.

FAQ

Common questions

No. RFC 5321 does not define 540 as a basic SMTP reply code. It is usually either a misread enhanced status code 5.4.0 (RFC 3463, "other or undefined network or routing status") or a provider-specific literal rejection, such as Rambler's "540 recipient address rejected: Inactive/Blocked."

One API, every provider

Stop debugging raw provider errors

Courier connects to your email, SMS, and push providers, handles retries and failover, and surfaces delivery errors in plain language.

Reply-code definitions per RFC 5321 §4.2.1; RFC 3463 §3.5 (X.4.0). Last reviewed Jul 1, 2026. Courier is not affiliated with third-party providers; error behavior may vary by implementation.