Lee este artículo en español.
How to validate an email in n8n (format and MX, one node)
If you automate lead intake with n8n (a form, a webhook, a new spreadsheet row), sooner or later you'll get a badly typed or outright fake email. Before that contact lands in your CRM or triggers a welcome email, it's worth checking it. With the regular HTTP Request node and the Cofferdock API, you check it in one step, nothing extra to set up.
Quick note: n8n has no dedicated "validate email" node. You do it with the HTTP Request node calling an API that runs two checks: that the format is correct, and that the domain actually has a mail server behind it (MX record). A good-looking email on a domain that doesn't exist gets caught too.
What you'll get
You send the email and it tells you whether it's valid, whether the format is correct, and whether the domain has a real MX record (mail server). No "looks like an email" guesswork: a real check against DNS.
Common uses in n8n:
- Filtering leads from a form before creating them in your CRM.
- Rejecting made-up emails at sign-up.
- Cleaning a list before importing it into your email marketing tool.
- Checking an order's email before sending the confirmation.
What you need
- A Cofferdock account. The free tier gives you 50 uses/month with no card.
- Your API key, from your dashboard with "+ Create key". It's shown only once, so copy and save it.
- An HTTP Request node in your n8n flow.
Step by step in the HTTP Request node
Add an HTTP Request node and fill it in like this:
- Method:
POST - URL:
https://api.cofferdock.com/validate-email - Send Headers: turn it on and add two:
x-api-keywith your key, andContent-Typewith the valueapplication/json. - Send Body: turn it on → Body Content Type:
JSON→ in the body:
{ "email": "={{ $json.email }}" }
- Under Options → Response → Response Format leave it as JSON.
The response includes valid (true/false), format_valid, mx_found and domain. With an IF node right after, you decide what to do based on valid.
A quick example
Say you filter form leads before creating them in your CRM:
- A trigger (a webhook from the form) with the lead's email.
- The HTTP Request node above, which validates it.
- An IF node that checks
{{ $json.valid }}: iftrue, it continues to the CRM; iffalse, it goes down a branch that discards it or flags it for manual review.
Leads with fake emails no longer clutter your CRM.
Options you can tweak
Add it in the same JSON body:
| Option | Default | What it does |
|---|---|---|
check_mx | true | Set it to false to check only the format (faster, no DNS lookup). |
Prefer to see it in code?
The same call with curl:
curl -X POST "https://api.cofferdock.com/validate-email" \
-H "x-api-key: YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"email": "hello@example.com"}'
How much does it cost?
Each check uses 1 credit from your plan, whether the email comes back valid or not (the answer itself is what you're paying for, not just a "yes"). Every Cofferdock tool draws from the same pool of credits.
FAQ
Does n8n have a native node to validate emails? No. You do it with the HTTP Request node calling the Cofferdock API, which checks the format and the MX record.
What if the email has a good format but the domain doesn't exist? format_valid comes back true but valid comes back false, because mx_found is false. That's exactly the case where a plain regex check produces the most false positives.
Can I turn off the MX check? Yes, with check_mx: false. It's faster, but it only checks the format, not whether the domain actually receives mail.
Can I validate several emails in a loop? Yes. If the previous node returns several rows, n8n runs the HTTP Request once per row and you get one result per lead.
Related guides
Try it yourself
You'll find the full instructions, with copy-paste examples, on the email validation page. And if you don't have an account yet, you can create one for free and build your first flow today.