Overview
The email validation API checks an address for syntax errors, disposable domains, role-based prefixes, free providers, and valid MX records -- all in a single request. Use it to clean signup forms, verify recipient lists, or gate sending to reduce bounces and protect your sender reputation.
API Reference
Validate an Email Address
POST /v1/validate
Requires an API key with the emails:validate scope.
curl -X POST https://api.euromail.dev/v1/validate \
-H "X-EuroMail-Api-Key: em_live_..." \
-H "Content-Type: application/json" \
-d '{"email": "[email protected]"}'
Request:
| Field | Required | Description |
|---|---|---|
email | Yes | The email address to validate. Accepts bare addresses ([email protected]) and display-name format ("Jane Doe" <[email protected]>). |
Response:
| Field | Type | Description |
|---|---|---|
email | string | The validated address (echoed back) |
valid | boolean | Overall validity. false if disposable, invalid syntax, or no MX records. |
deliverable | string | "yes", "no", or "unknown" |
is_disposable | boolean | Whether the domain is a known disposable email provider |
is_role | boolean | Whether the local part matches a role-based prefix (e.g. admin@, support@) |
is_free | boolean | Whether the domain is a known free email provider (e.g. Gmail, Yahoo) |
mx_found | boolean | Whether MX records were found for the domain |
reason | string or null | Explanation when validation fails |
Validation Checks
Each request runs five checks in sequence:
1. RFC 5322 Syntax
Validates the address against a practical subset of RFC 5322:
- Local part (before
@): 1-64 characters. Alphanumeric plus. + - _ ! # $ % & ' * / = ? ^ { | } ~. No leading, trailing, or consecutive dots. - Domain part (after
@): 1-253 characters. Valid hostname labels separated by dots. Labels are 1-63 characters, alphanumeric plus hyphen, no leading or trailing hyphens. At least one dot required.
2. Disposable Domain Detection
Checks the domain against a list of 1,001 known disposable email providers (mailinator.com, 10minutemail.com, guerrillamail.com, etc.). The list is compiled at build time for fast lookup.
3. Role-Based Address Detection
Checks whether the local part matches one of 43 role-based prefixes:
abuse, admin, administrator, billing, compliance, devnull, dns, ftp, help, hostmaster, info, mailer-daemon, marketing, media, no-reply, noc, noreply, office, operations, postmaster, privacy, registrar, remove, root, sales, security, spam, ssladmin, support, sysadmin, tech, undisclosed-recipients, unsubscribe, usenet, uucp, webmaster, www
Role-based addresses are often shared inboxes and tend to generate more complaints. The is_role flag lets you decide whether to accept them.
4. Free Provider Detection
Checks the domain against 56 known free email providers, including:
- Gmail: gmail.com, googlemail.com
- Yahoo: yahoo.com and regional variants (yahoo.co.uk, yahoo.co.jp, yahoo.fr, yahoo.de, etc.)
- Microsoft: outlook.com, hotmail.com, live.com, msn.com and regional variants
- Apple: icloud.com, me.com, mac.com
- Privacy-focused: protonmail.com, protonmail.ch, proton.me, pm.me, tutanota.com, tuta.io
- European: gmx.com, gmx.de, web.de, t-online.de
- Other: aol.com, mail.com, zoho.com, fastmail.com, yandex.com, mail.ru
5. MX Record Lookup
Performs an asynchronous DNS lookup for MX records on the domain. Results are cached for 1 hour (up to 10,000 domains) to avoid redundant lookups. The lookup has a 5-second timeout with 2 retry attempts.
- MX found: The domain has at least one MX record and can receive email.
- MX not found (definitive): The domain returned NXDOMAIN or no records. This result is cached.
- MX lookup failed (transient): A timeout or network error occurred. The result is not cached and
deliverableis set to"unknown".
Decision Logic
The checks determine the final valid and deliverable values:
| Condition | valid | deliverable | reason |
|---|---|---|---|
| Disposable domain | false | "no" | "Disposable email domain" |
| No MX records (definitive) | false | "no" | "No MX records found for domain" |
| MX lookup timed out | true | "unknown" | Error message from DNS resolver |
| All checks passed | true | "yes" | null |
Note that is_role and is_free are informational flags. They do not affect valid or deliverable.
Response Examples
Valid email
{
"email": "[email protected]",
"valid": true,
"deliverable": "yes",
"is_disposable": false,
"is_role": false,
"is_free": true,
"mx_found": true,
"reason": null
}Disposable domain
{
"email": "[email protected]",
"valid": false,
"deliverable": "no",
"is_disposable": true,
"is_role": false,
"is_free": false,
"mx_found": true,
"reason": "Disposable email domain"
}Role-based address
{
"email": "[email protected]",
"valid": true,
"deliverable": "yes",
"is_disposable": false,
"is_role": true,
"is_free": false,
"mx_found": true,
"reason": null
}No MX records
{
"email": "[email protected]",
"valid": false,
"deliverable": "no",
"is_disposable": false,
"is_role": false,
"is_free": false,
"mx_found": false,
"reason": "No MX records found for domain"
}Use Cases
Signup form validation -- Call /v1/validate when a user registers. Reject disposable domains, warn on deliverable: "unknown", and flag role-based addresses for review.
List cleaning -- Before importing a recipient list, validate each address in batch. Remove entries where valid is false to reduce hard bounces.
Pre-send checks -- Validate the to address before calling /v1/emails to avoid wasting quota on undeliverable addresses.