Someone types an email address into your signup form. Before you store it, you want one answer: is this address real? There is no single test for that. A good check stacks four layers, and each one answers a smaller question. This post walks through those layers, shows what a real SMTP conversation looks like, and points out where the answers get fuzzy.
Layer 1: syntax
The first layer is cheap. It looks at the string and nothing else. A missing @, two dots in a row, a space, or a domain with no dot all fail here. You can run this in the browser before the form submits.
Syntax tells you an address is possible. It does not tell you it exists. jane.doe@example.com is perfectly formed, and that proves nothing about Jane.
Layer 2: the domain and its MX records
Next, the check asks DNS where mail for the domain should go. That answer lives in MX records.
dig +short MX example.com A typical answer lists one or more mail hosts with a priority number. No answer at all is a strong warning. Mail has nowhere to land.
There is one catch. RFC 5321 lets a sender fall back to the domain's A record when no MX exists. Very few real mail domains rely on that, but some do. So "no MX" deserves a second look before you call it final. A domain can also publish a null MX (0 ., from RFC 7505). That one is explicit: the domain accepts no mail at all.
Layer 3: asking the mail server
Now the check talks to the receiving server over SMTP, the same protocol a sending server uses. It goes far enough to ask about the recipient, then stops before any message is sent.
S: 220 mx.example.com ESMTP C: EHLO checker.example.net S: 250-mx.example.com C: MAIL FROM:<probe@example.net> S: 250 2.1.0 OK C: RCPT TO:<jane.doe@example.com> S: 250 2.1.5 OK C: QUIT S: 221 2.0.0 Bye The interesting line is the reply to RCPT TO. A 250 means the server is willing to take mail for that mailbox. A 550 5.1.1 usually means the user does not exist. Because the client quits before DATA, Jane never receives anything.
This is the layer that separates a deliverability check from a format check. It is also the slowest and the most fragile, which brings us to the gaps.
Where the answers go quiet
Catch-all domains. Some servers answer 250 for every address on the domain, real or not. You can detect this by asking about a random local part that cannot exist. If the server accepts that too, the domain is catch-all. Any "yes" from it is meaningless for a single mailbox. An honest check labels the address as catch-all instead of calling it valid.
Greylisting. Some servers reply with a temporary 4xx code to anyone they have not seen before. A real sender retries later and gets through. A check that sees 450 or 451 cannot conclude anything yet. The right result is "unknown, retry later", not "invalid".
Rate limits and vague replies. Large providers throttle repeated probes, and some answer the same way for every recipient. This is why no tool can promise one fixed accuracy number for every domain.
Your own network. If you try this from a cloud server, you may not get far. Google Cloud blocks outbound port 25, and AWS EC2 and Azure restrict it by default. Even where the port is open, a fresh IP that opens many SMTP sessions and never sends mail starts to look like a spammer.
Layer 4: risk flags
An address can exist and still be a poor bet. These checks have nothing to do with SMTP. They compare the address against maintained lists and patterns:
- Disposable: the domain belongs to a temporary inbox service. Expect a bounce later or zero engagement.
- Role: the local part is a function, such as
info@,support@orsales@. Fine for a support ticket, weak for outreach. - Catch-all: covered above. The domain accepts everything.
- Free webmail: a consumer provider rather than a company domain. Useful context for B2B lists.
These flags are independent. One address can be deliverable, role-based and on a catch-all domain all at once. Folding them into one score hides the reason you would act on.
Turning results into form behavior
The layers give you a result. Your form still has to decide what the user sees. A useful rule: only block what is certainly wrong, and never punish the user for a mail server's silence.
// result: { status, is_disposable, is_role } from your check function signupDecision(result) { if (result.status === "invalid") { return { allow: false, message: "That address can't receive email. Check for a typo?" }; } if (result.status === "disposable" || result.is_disposable) { return { allow: false, message: "Please use a permanent email address." }; } if (result.status === "valid" && !result.is_role) { return { allow: true, needsConfirmation: false }; } // unknown, catchall, risky or role: the mailbox is not confirmed or needs a second look. // Let them in and confirm by email. return { allow: true, needsConfirmation: true }; } The two allow: false cases are the ones you can trust. An invalid mailbox will bounce your welcome email anyway. A disposable inbox will be gone in an hour. Everything else gets in, and a confirmation email settles the rest.
Write the error message for a human. "Invalid email" tells the user nothing. "That address can't receive email. Check for a typo?" tells them what to do. Most failures at signup are typos, such as gmial.com or a missing letter, and a clear message fixes them on the spot.
Role addresses are a judgment call. A shared info@ inbox is fine for a B2B trial, but it is a weak signal for a consumer app. The example lets them in and asks for confirmation.
Putting it together
For a signup form, run syntax in the browser and the rest on the server. Block clear failures, and be careful with catch-all and unknown results. A hard rejection there would turn away real people.
For a one-off address, you do not need to build any of this. Paste it into a tool that runs all four layers. With BillionVerify you can check whether an email address exists in a few seconds: syntax, MX, a live SMTP check, and the risk flags, each reported on its own. It gives 20 full checks every 24 hours with no sign-up, and it does not keep the addresses you check.
If you want the full detail on the SMTP step, including more reply codes, we wrote a longer guide on SMTP email verification.
