// forms and surveys
Via APINetlify Forms email verification with pingutil
Netlify Forms catches a lot of bot spam, but a real visitor with a typo or a temp-mail address still gets through to your notifications and integrations. A Netlify Function subscribed to the formSubmitted event receives each verified submission, checks the email with pingutil and forwards only reachable contacts. The handler cannot reject the submission, so this is post-submit routing.
Where it connects: Netlify Functions event handler for formSubmitted (FormSubmittedEvent)
What goes wrong without it
- Netlify Forms emails us every submission, and replies to some of them bounce.
- We send new submissions to a Slack channel and half of them are throwaway addresses.
- We wanted one place to add lead logic without standing up a separate backend.
What you can do with Netlify Forms and pingutil
Send only reachable leads to Slack or the CRM
Instead of the built-in notification, let the function post valid submissions to Slack or your CRM with the pingutil status attached.
Drop disposable sign-ups from your list
Skip adding addresses with verdict.is_spam to your newsletter tool, even though Netlify keeps the raw submission.
Tag company leads
A full /v1/lookup on company domains returns the company name and industry, so you can prioritize those messages.
Set it up
- 1
Create a pingutil key and add it to the site as the PINGUTIL_KEY environment variable, plus LEADS_WEBHOOK_URL for where clean leads go.
- 2
Add the function below at netlify/functions/screen-leads.mts.
- 3
Make sure your form has an input named email; event.data is keyed by field name.
- 4
Deploy, submit the form, and check the function log for the pingutil status.
import type { FormSubmittedEvent } from '@netlify/functions';
async function pingutil(path: string, body: object, ms: number) {
try {
const res = await fetch('https://pingutil.com' + path, {
method: 'POST',
headers: { authorization: 'Bearer ' + process.env.PINGUTIL_KEY, 'content-type': 'application/json' },
body: JSON.stringify(body),
signal: AbortSignal.timeout(ms),
});
return res.ok ? await res.json() : null;
} catch {
return null; // fail open
}
}
export default {
async formSubmitted(event: FormSubmittedEvent) {
const email = (event.data.email ?? '').trim(); // keyed by your form's field names
if (!email) return;
const fast = await pingutil('/v1/lookup', { input: email, skip_enrichment: true }, 3000);
if (fast?.verdict?.is_spam) {
console.log('netlify form spam', fast.verdict.reason);
return;
}
const check = await pingutil('/v1/verify', { email }, 15000);
if (check?.status === 'invalid') {
console.log('netlify form invalid email', check.reason, check.did_you_mean);
return;
}
await fetch(process.env.LEADS_WEBHOOK_URL!, {
method: 'POST',
headers: { 'content-type': 'application/json' },
body: JSON.stringify({
email,
name: event.data.name ?? '',
email_status: check?.status ?? 'unchecked',
category: fast?.category ?? null,
}),
});
},
};What to do with each result
| pingutil result | Action in Netlify Forms |
|---|---|
| verdict.is_spam: true | Do not forward; the submission stays in the Netlify Forms dashboard. |
| status: "valid" | Post to Slack, the CRM or your email list. |
| status: "invalid" | Log it with did_you_mean and skip forwarding. |
| status: "risky" or "unknown" | Forward with the status so a person can decide. |
Limits to plan for
- The formSubmitted handler's return value is ignored, so it cannot reject a submission. Netlify still stores it and runs its own notifications unless you turn those off.
- Netlify documents only event.data (field name to string value) on this event, so there is no submission id to correlate with unless you add one as a form field.
- Function execution time limits apply. The snippet caps the mailbox check at 15 seconds and forwards unchecked on timeout.
Netlify Forms documentation
Netlify Forms is a trademark of its owner. This integration uses Netlify Forms's documented extension points; it is not an official Netlify Forms app.
Common questions
- Can a Netlify function block a form submission?
- No. Netlify documents event.deny() only for Identity events. For forms, the function runs after the submission is verified and its return value is not used.
- Does Netlify Forms spam filtering already catch disposable emails?
- Netlify Forms spam filtering is aimed at bot submissions. It is not a mailbox or disposable-domain check, so a real person with a temp-mail address or a typo still gets through.
Stop bad addresses in Netlify Forms today
Sign in with your email, create an API key and paste it into the step above. Test on a few real addresses first: the live demo shows exactly what your Netlify Forms setup will receive.