Prompt
Need API email verification with disposable email detection
Latest observation
Oct 5, 2026
OpenAI APIWeb search: off
You can build this in two layers:
- Email verification — check format, domain, MX records, and optionally SMTP reachability
- Disposable email detection — compare the domain against a disposable-email domain list or a reputation API
Recommended API flow
Endpoint
POST /verify-email
Request
{
"email": "user@example.com"
}
Response
{
"email": "user@example.com",
"valid_format": true,
"domain": "example.com",
"mx_found": true,
"disposable": false,
"deliverable": true,
"status": "ok"
}
Verification checks
1) Syntax validation
Use a standard email parser / regex to ensure the address is formatted correctly.
2) Domain validation
Check:
- domain exists
- MX records are present
- optionally A/AAAA fallback if no MX
3) Disposable email detection
Use one of these approaches:
- Local blocklist: maintain a list of known disposable domains
- Third-party API: e.g. Kickbox, ZeroBounce, NeverBounce, Emailable, Hunter
- Hybrid: blocklist + API for better coverage
4) SMTP verification (optional)
Try an SMTP handshake to test if the mailbox appears valid.
Note: many providers block this or give false positives/negatives.
Simple implementation example (Node.js)
Install
npm install validator dns-packet
Example
const validator = require("validator");
const dns = require("dns").promises;
const disposableDomains = new Set([
"mailinator.com",
"10minutemail.com",
"guerrillamail.com",
"tempmail.com"
]);
async function verifyEmail(email) {
const result = {
email,
valid_format: false,
domain: null,
mx_found: false,
disposable: false,
deliverable: false,
status: "invalid"
};
if (!validator.isEmail(email)) return result;
result.valid_format = true;
const domain = email.split("@")[1].toLowerCase();
result.domain = domain;
result.disposable = disposableDomains.has(domain);
try {
const mx = await dns.resolveMx(domain);
result.mx_found = mx && mx.length > 0;
result.deliverable = result.mx_found && !result.disposable;
result.status = result.deliverable ? "ok" : "review";
} catch (e) {
result.mx_found = false;
result.deliverable = false;
result.status = "invalid_domain";
}
return result;
}
// Example usage
verifyEmail("test@mailinator.com").then(console.log);
If you want higher accuracy
Use an email verification provider with disposable detection built in:
- Kickbox
- ZeroBounce
- NeverBounce
- Hunter
- Abstract API
These typically return:
- valid/invalid
- catch-all
- role-based
- disposable
- free provider
- SMTP status
Suggested API contract
If you’re exposing this as your own API, a good response shape is:
{
"email": "user@example.com",
"is_valid": true,
"is_disposable": false,
"is_catch_all": false,
"domain_exists": true,
"mx_exists": true,
"reason": null
}
If you want, I can provide:
- a full FastAPI/Python implementation,
- a Node.js/Express endpoint, or
- integration with a third-party verification API.