How to Validate an Email Address: 5 Checks That Work
You validate an email address by running five checks in order: syntax, MX records, disposable domains, role addresses and typos. The first two tell you whether mail can be delivered at all. The last three tell you whether the address is worth keeping. A single regex covers only the first.
This guide walks through each check, shows what a real response looks like, and gives you code to run all five in one call.
What does it mean to validate an email address?
Validating an email address means confirming it is well formed, its domain can receive mail, and it is likely to belong to a real person. It does not prove a specific mailbox exists. Only an SMTP probe or a confirmation email can do that.
Teams mix up three levels of certainty:
| Level | What it proves | How to check |
|---|---|---|
| Format | The string follows email syntax | Syntax check |
| Domain | The domain is set up to receive mail | MX lookup |
| Mailbox | This exact inbox exists and is monitored | SMTP probe or confirmation link |
Most signup forms need the first two levels plus some quality filters. That is what the five checks below cover.
How do you check email syntax?
Check that the address has one local part, one @, and a domain made of valid labels. RFC 5321 caps the local part at 64 characters and the path at 256 including angle brackets, which leaves 254 for the address itself (RFC 5321, section 4.5.3.1).
A practical syntax check does this:
- Split on the last
@. Reject if either side is empty. - Reject if the whole address is over 254 characters or the local part is over 64.
- Allow only valid characters in the local part: letters, digits and
.!#$%&'*+/=?^_{|}~-`. - Split the domain on dots. Require at least two labels, each 1 to 63 characters, using letters, digits and hyphens, and not starting or ending with a hyphen.
Do not try to match the full RFC grammar with one regex. The pattern grows into something nobody can maintain, and it still says nothing about whether the domain exists. Use a short structural check and let the next steps do the real work.
How do you check MX records for an email domain?
Query the domain's DNS for MX records. If none exist, the domain cannot receive mail and the address is invalid. An MX record names the mail server that accepts email for that domain.
From a terminal:
dig +short MX gmail.com
A healthy domain returns one or more hostnames with priorities. An empty result means the address will bounce. This check catches made-up domains, expired domains and typos that land on nothing, such as a domain someone mistyped and nobody registered.
ValidateEasy runs this lookup over DNS-over-HTTPS, so you can do it from environments that block raw DNS, like edge functions and browsers' backends.
How do you detect disposable email addresses?
Compare the domain against a maintained list of throwaway providers such as Mailinator. A disposable address is a temporary inbox that anyone can open without an account, so people use it to skip your signup flow or claim a free trial repeatedly.
Disposable domains pass syntax and MX checks, because they run real mail servers. Only a domain list catches them. The list also goes stale, since new throwaway domains keep appearing. If you maintain your own, plan to update it. If you use an API, the provider does that for you. ValidateEasy checks against 150+ disposable domains.
How do you flag role-based email addresses?
Check whether the local part is a shared-inbox name like info, admin, support, sales or noreply. A role address is a mailbox that belongs to a team or function, not one person.
Role addresses are deliverable, but they suit marketing mail poorly. Several people read them, nobody owns the relationship, and nobody reads noreply@ at all. Mark them risky instead of rejecting them. A contact form that asks for a billing contact may reasonably accept billing@.
How do you catch email typos?
Compare the domain to a map of common misspellings and suggest the correction. The usual offenders are gamil.com, gmial.com, hotmial.com and yaho.com.
A mistyped domain can pass syntax, and it can pass MX if someone registered it. Prompting the user at entry ("Did you mean gmail.com?") fixes the problem while they are still on the page.
What does a real validation result look like?
A good validator returns a status plus the result of each check, so you can decide what to do with each failure. We ran four test addresses through the ValidateEasy MCP server:
| Address | Status | Reason | Flag raised |
|---|---|---|---|
| test@gmail.com | Okay to send | Accepted | free provider (informational) |
| info@example.com | Risky | Role Address | role address |
| someone@mailinator.com | Do not send | Disposable | disposable domain |
| user@gamil.com | Risky | Possible Typo | typo, suggestion: "Did you mean gmail.com?" |
All four passed the syntax and MX checks. Syntax and MX alone would have approved every one of them, including the disposable inbox and the typo.
ValidateEasy uses three statuses. valid means deliverable. invalid means it will bounce. risky means deliverable but low quality, such as a role address, a typo or a catch-all domain.
How do you validate an email address with an API?
Send the address to a validation endpoint and branch on the status field. If you are still choosing a provider, see what to look for in an email validation API. One request runs all five checks:
curl "https://api.validateeasy.com/validate?email=user@gamil.com" \
-H "X-Api-Key: YOUR_KEY"
The response includes status, reason, a checks object with syntax, mx, disposable, role, free_provider and typo flags, and a suggestion when it spots a typo.
For lists, post an array. The limit per request is 50 emails on the free plan, 100 on Starter and 500 on Pro:
curl -X POST "https://api.validateeasy.com/validate" \
-H "X-Api-Key: YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"emails": ["test@gmail.com", "info@example.com"]}'
A sensible rule for a signup form:
invalid: block and ask for a different address.riskywith asuggestion: show "Did you mean...?" and let the user confirm.riskyfor a role address: accept, but tag it so marketing can exclude it.valid: accept.
The free plan includes 1,000 validations a month, which covers most early-stage signup forms.
Can you check that a mailbox exists?
Sometimes. An SMTP probe asks the receiving mail server whether it would accept mail for the exact address, without sending a message. Many providers block or throttle these probes, and catch-all domains accept everything, so the answer is not always available.
On ValidateEasy's Starter and Pro plans, the response can include catch_all and mailbox_verified. Both run asynchronously. The first call may return null while the probe is queued, results are cached, and the fields are omitted when a provider blocks probing. Treat them as extra signal, not a guarantee. For a hard guarantee of ownership, send a confirmation link.
FAQ
Can I validate an email address without sending an email?
Yes. Syntax, MX, disposable, role and typo checks all run without sending anything. Only proof of ownership needs a confirmation email, because no lookup can show that a person reads the inbox.
Is a regex enough to validate an email?
No. A regex only checks format. It accepts user@notarealdomain.xyz and someone@mailinator.com, so it misses dead domains, throwaway inboxes and typos.
What is the difference between a valid and a risky email?
A valid address passed every check. A risky address is deliverable but has a quality problem: it is a role address, a likely typo or on a catch-all domain. Risky addresses are worth keeping with a tag, not deleting.
How often should I re-validate an email list?
Re-validate before any large send and whenever a list has sat unused for a few months, since domains expire and people change jobs. Validate new signups at entry so the list starts clean.