SMTP

SMTP Error 512

"SMTP Error 512" isn't a real reply code — it's a vendor label for enhanced status 5.1.2, an unresolvable recipient domain. Here's the accurate cause and fix.

Updated Jul 1, 2026

The short answer

"SMTP Error 512" is not a real SMTP reply code — RFC 5321 defines no 512. It is an informal label used across hosting/ESP support docs (SendLayer, KnownHost, and others) for the enhanced status code 5.1.2, "Bad destination system address" (RFC 3463): the recipient's domain after the "@" cannot be resolved or has no mail server. Fix it by correcting the domain typo or fixing the recipient domain's MX/DNS records.

Is "SMTP Error 512" a real SMTP code?

No. There is no reply code 512 in SMTP. Per RFC 5321 §4.2, every SMTP reply is a three-digit code, and per RFC 5321 §4.2.1 the second digit classifies the response — x0z syntax, x1z informational, x2z connections, x5z mail system. There is no registered 5 1 2 reply, and you will never see a literal 512 in a raw SMTP transcript or bounce header.

"Error 512" is an informal label used across various hosting/ESP support docs — SendLayer, KnownHost, and others — for what the mail system actually returned: the enhanced status code 5.1.2. Under RFC 3463 §3.2, X.1.2 is "Bad destination system address":

"The destination system specified in the address does not exist or is incapable of accepting mail. For Internet mail names, this means the address portion to the right of the '@' is invalid for mail."

So when a tool says "512," read it as 5.1.2 — the recipient's domain could not be resolved. On the wire this typically arrives as 550 5.1.2 ... (permanent), or, while DNS is flapping, a transient 4xx such as 451 4.4.7 or 450 4.1.2 — both are equally standard under RFC 3463, just less commonly observed than the permanent form.

What causes a 5.1.2 / "512" domain-not-found error?

The address to the right of the @ cannot be turned into a deliverable mail server. Concretely:

  • Typo in the domaingmial.com, domain.coom, outlok.com. The domain simply doesn't exist in DNS.
  • The domain has no MX (or fallback A) record — it resolves, but advertises no mail server. Note this is distinct from X.1.1 (bad mailbox — the part left of the @).
  • NXDOMAIN / expired domain — the recipient's domain lapsed or was never registered.
  • A DNS resolution failure on the path — your sending server (or its resolver) can't reach the recipient domain's nameservers. When this is transient it should be reported in the 4.x.x class, not 5.x.x.

How do I fix SMTP Error 512?

1. Check the recipient domain for typos first. This is the most common cause. Verify the spelling of everything after the @.

2. Confirm the recipient domain actually has a mail server. Look up its MX records:

dig MX recipient-domain.com +short
# or
nslookup -type=MX recipient-domain.com

If this returns nothing, the domain has no MX record and cannot receive mail. If the domain resolves but publishes zero MX records, RFC 5321 §5.1 treats it as having an implicit MX (preference 0) at its own name, so mail servers still try its A/AAAA record. This fallback does not apply if the domain name itself fails to resolve (NXDOMAIN) — that is a hard, non-recoverable error. Tools like MXToolbox or DNS Checker give the same answer in a browser. If the recipient's domain is misconfigured, only their administrator can fix it — the message is undeliverable from your side.

3. If many recipients across different domains fail, suspect your own resolver. A 512/5.1.2 (or a transient 4.1.2/4.4.7) on every send usually means your sending host can't resolve DNS at all. Verify it can reach a working resolver:

dig MX gmail.com +short # should return Google's MX hosts

If that fails too, fix the sending server's /etc/resolv.conf, firewall egress on UDP/TCP 53, or upstream DNS — not the recipient.

With Courier

If you send email via Courier, an unresolvable recipient domain surfaces on the message's delivery status from the downstream provider (SendGrid, Amazon SES, Mailgun, etc.). Courier's message logs typically pass through the downstream provider's bounce/status text, which may include a 5.1.2-style reason — inspect it in the Courier logs or via the message API. A "domain not found" reason points at the recipient's address or DNS, so correct the stored address or remove the dead domain from your audience — retrying the same address will bounce identically.

FAQ

Common questions

No. RFC 5321 defines no 512 reply code, and you won't see a literal 512 in a raw SMTP transcript. It's an informal label used across hosting/ESP support docs for the enhanced status code 5.1.2 (RFC 3463), meaning the recipient's domain could not be resolved or accepts no mail.

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 3463 §3.2 (X.1.2); RFC 5321 §4.2.1. Last reviewed Jul 1, 2026. Courier is not affiliated with third-party providers; error behavior may vary by implementation.