Email Validator: Validation
Validate Email
Check one address before you send to it: format, domain, MX, temporary providers, typos, spam traps and whether the mailbox really exists.
https://g.sendcorex.com/v1/tool/validatecommand: validate_emailNeeds the tools:validate scope on your API key.
Uses 1 validation credit.
Arguments
emailstringrequiredThe address to check. Up to 254 characters.
e.g.
"ana@acme.com"
Quick start
import axios from 'axios';
const response = await axios.post(
'https://g.sendcorex.com/v1/tool/validate',
{
commands: [
{
command: "validate_email",
args: {
email: "ana@acme.com"
}
}
]
},
{ headers: { Authorization: process.env.SENDCOREX_API_KEY } },
);
const [result] = response.data.results;
if (result.type !== 'SUCCESS') throw new Error(`${result.code}: ${result.message}`);
console.log(result.data);Response
{
"type": "SUCCESS",
"results": [
{
"command": "validate_email",
"id": "0",
"type": "SUCCESS",
"took_ms": 18,
"data": {
"email": "ana@acme.com",
"valid": true,
"checks": [
{
"check": "Format Validation",
"status": "Passed",
"details": "Valid email format"
},
{
"check": "Local Part Validation",
"status": "Passed",
"details": "Local part is RFC compliant"
},
{
"check": "Role-based Email Check",
"status": "Passed",
"details": "Not a role-based address"
},
{
"check": "No-reply Email Check",
"status": "Passed",
"details": "Not a no-reply address"
},
{
"check": "Temporary Email Check",
"status": "Passed",
"details": "Not a temporary email"
},
{
"check": "Misspelled Domain Check",
"status": "Passed",
"details": "Correct"
},
{
"check": "Spam Trap Check",
"status": "Passed",
"details": "Not a spam trap"
},
{
"check": "Provider Type",
"status": "Passed",
"details": "Corporate or custom domain"
},
{
"check": "Domain Validation",
"status": "Passed",
"details": "Domain is valid and has MX records"
},
{
"check": "Null MX Check",
"status": "Passed",
"details": "Domain accepts email"
},
{
"check": "Email Provider Detection",
"status": "Passed",
"details": "Domain is hosted on a known provider: Google Workspace",
"providerId": 1,
"providerName": "Google Workspace"
},
{
"check": "Email Deliverability",
"status": "Passed",
"details": "Mailbox exists",
"fullResponse": "250 2.1.5 OK"
},
{
"check": "Catch-all Mail Exchanger Check",
"status": "Passed",
"details": "Mail exchanger correctly rejects nonexistent addresses"
}
]
}
}
]
}Response fields
emailThe address, trimmed and in lowercase.
validtrueonly when every check passed.Provider TypeandEmail Provider Detectionare informative and never make itfalse.checks[].checkThe name of the check. See Checks below.
checks[].statusPassedorFailed.checks[].detailsA sentence explaining the result, ready to show to a user.
checks[].fullResponseOnly on
Email Deliverability: the exact answer of the mailbox server.checks[].providerId / providerNameOnly on
Email Provider Detection: the mailbox provider that hosts the domain.
Checks
They run in this order and stop early when there is no point going on (no MX, bad format…).
Format ValidationThe address has a valid shape. If it fails, nothing else runs.
Local Part ValidationThe part before
@follows RFC 5322 (length, dots, characters).Role-based Email CheckInformative: tells you if it is a team address like
info@oradmin@. Never fails.No-reply Email CheckFails for
noreply@and similar addresses, which do not read what they get.Temporary Email CheckFails for disposable and temporary providers.
Misspelled Domain CheckFails for common typos of big providers (
gmial.com,hotmial.com…) and suggests the right one.Spam Trap CheckFails for domains known to be spam traps.
Provider TypeInformative: free/personal provider or a corporate domain.
Domain ValidationThe domain exists and has MX records.
Null MX CheckFails when the domain says it does not accept email (RFC 7505).
Email Provider DetectionInformative: the mailbox provider, when we know it.
Email DeliverabilityWe ask the mailbox server if the address exists, without sending anything. Only runs when every check above passed.
Catch-all Mail Exchanger CheckOnly for corporate domains. Fails when the server accepts any address, so the mailbox cannot be confirmed.
Using the result
Block the signupWhen
validisfalse, show thedetailsof the first failed check to the user.Suggest the fixMisspelled Domain Checkcomes with the corrected address indetails: offer it with one click.Catch-allA failed catch-all check means the server accepts anything. The address may exist, but nobody can prove it before sending.
Errors
HTTP-level errors return type, code and message. Errors marked CMD come back inside the command result, with HTTP 200.
- 401
INVALID_API_KEYThe API key does not exist, was revoked or was disabled in the dashboard.
- 429
RATE_LIMITEDMore than 75 requests/s or 75 in flight for the same IP + API key. Wait the number of seconds in Retry-After.
- CMD
MISSING_SCOPEThe API key does not have `tools:validate`.
- CMD
INVALID_ARGSAn argument is invalid: missing email (or domain, for `check_disposable`), more than 50 emails, an address longer than 254 characters, limit out of range…
- CMD
INSUFFICIENT_CREDITSYou do not have enough credits for the whole command (validation credits for `validate_*`, disposable credits for `check_disposable`). Nothing was checked and nothing was charged.
- CMD
CREDITS_UNAVAILABLEYour credits could not be read right now. Nothing was charged. Try again.
- CMD
NO_SERVERS_AVAILABLENo validation server is available right now. Nothing was charged. Try again shortly.
- CMD
VALIDATION_FAILEDThe validation servers did not answer in time. Your credits were returned. Try again.
- CMD
INTERNALServer error. The detail is only written to the server log.