Email Validation
Validate email addresses before sending to reduce bounces, protect your sender reputation, and improve deliverability. Checks syntax, MX records, disposable domains, role addresses, and common typos.
- RFC 5322 syntax validation
- Live MX record lookup
- Disposable/temporary domain detection
- Role address detection (admin@, info@, etc.)
- Free provider detection (gmail, yahoo, etc.)
- Typo suggestions for common domain misspellings
Validate an Email
POST /v1/emails/validateimport { VeilMail } from '@resonia/veilmail-sdk';
const client = new VeilMail('veil_live_xxxxx');
const result = await client.validation.validate('user@example.com');
console.log(result.verdict); // "valid" | "risky" | "invalid"
console.log(result.score); // 0.0 to 1.0
console.log(result.checks); // Detailed check resultsResponse Format
{
"email": "user@example.com",
"verdict": "valid",
"score": 0.95,
"checks": {
"syntax": { "valid": true },
"mx": {
"valid": true,
"records": ["mx1.example.com", "mx2.example.com"]
},
"disposable": { "disposable": false },
"role": { "role": false },
"freeProvider": { "free": false }
},
"suggestion": null
}Verdicts
| Verdict | Score | Meaning |
|---|---|---|
| valid | ≥ 0.8 | Safe to send. All critical checks passed. |
| risky | 0.4 – 0.79 | Proceed with caution. May be a disposable or role address. |
| invalid | < 0.4 | Do not send. Invalid syntax, no MX records, or high risk. |
Validation Checks
| Check | Score Impact | Description |
|---|---|---|
| Syntax | Fail = 0.0 | RFC 5322 format validation |
| MX Records | Fail = 0.0 | DNS MX record lookup verifying the domain can receive email |
| Disposable | -0.6 | Checks against known disposable/temporary email providers |
| Role Address | -0.2 | Detects generic role addresses (admin@, info@, support@, etc.) |
| Free Provider | -0.1 | Identifies free email providers (gmail, yahoo, hotmail, etc.) |
Batch Validation
POST /v1/emails/validate/batchValidate up to 100 email addresses in a single request:
const result = await client.validation.validateBatch([
'valid@example.com',
'user@mailinator.com',
'bad-syntax',
'admin@company.com',
]);
for (const r of result.results) {
console.log(`${r.email}: ${r.verdict} (score: ${r.score})`);
}
// valid@example.com: valid (score: 0.95)
// user@mailinator.com: invalid (score: 0.3)
// bad-syntax: invalid (score: 0)
// admin@company.com: risky (score: 0.75)Typo Suggestions
The validator detects common domain misspellings and suggests corrections:
const result = await client.validation.validate('user@gmial.com');
console.log(result.suggestion);
// "Did you mean user@gmail.com?"
console.log(result.verdict);
// "invalid" (no MX records for gmial.com)Common corrections include: gmial.com → gmail.com, yaho.com → yahoo.com, hotmal.com → hotmail.com, outlok.com → outlook.com, and more.
Pre-send Validation Pattern
Use validation before sending to protect your sender reputation:
async function safeSend(to: string, subject: string, html: string) {
// Validate first
const validation = await client.validation.validate(to);
if (validation.verdict === 'invalid') {
throw new Error(`Invalid email: ${to} (score: ${validation.score})`);
}
if (validation.verdict === 'risky') {
console.warn(`Risky email: ${to} - ${JSON.stringify(validation.checks)}`);
// Decide whether to proceed based on your risk tolerance
}
// Safe to send
return client.emails.send({
from: 'hello@yourdomain.com',
to,
subject,
html,
});
}Rate Limits
Validation endpoints are rate limited to 100 requests/minute for single validation and 10 requests/minute for batch validation. MX lookups involve DNS queries and may add latency.
SDK Support
Email validation is available in the Node.js SDK via client.validation. For other SDKs, use the REST API directly.