Forms

Cognito Forms email validation integration

A snippet you paste below your Cognito Forms embed code checks the email address when the respondent presses Submit, and stops the form when it cannot receive mail or is a throwaway inbox. A small relay you deploy to your own Cloudflare account checks each new entry the form posts to it and writes the result into a field of the entry.

Read the full setup guideGet an API key

  • Setup guide
  • A snippet and a relay you download

cognito-forms-guard.htmlpasted below the form’s embed code

Settings
emailField: 'Email',
browserKey: 'YOUR_BROWSER_KEY',
stop: ['invalid', 'disposable'],

At a glance.

Status
Setup guide. Not listed on a marketplace yet: you set it up yourself in a few steps, below and in the full guide.
For
Teams who collect sign-ups, orders or registrations with Cognito Forms and want to keep addresses that will bounce out of their entries, or at least see them marked.
You need
For the snippet, a browser key: API keys → Create key → “On a public web page”, with your site’s address as an allowed origin and a daily credit cap. For the relay, an API key with Validate addresses, a Cognito Forms API key with Entry scope Read/Write, a Textbox field for the result and a Cloudflare account to run the relay in.
Costs
1 credit = 1 validated address, as with any API request. Free: unknown results, API errors, malformed addresses, test addresses on sandbox.email-validation.org, addresses on reserved domains such as example.com and, in a bulk list, repeats of an address (charged once).
Full guide
Read the full setup guide

Typical uses.

  • Stop a bad address at Submit

    The snippet hooks into the form’s documented beforeSubmit event: the form waits for the check, at most 3 seconds, and shows your message instead of sending.

  • See the result on each entry

    The relay reads each new entry back from Cognito Forms, checks its email fields and writes a line such as invalid (no_mailbox), checked and the time into the field you added.

  • Hear about it elsewhere

    The relay can also post each entry’s results, signed, to a URL of yours, with ids and results only unless you ask for the address.

Set it up. 5 steps.

The short version of the full setup guide, which stays the reference when a step does not match what you see.

Read the full setup guide

  1. Download and unzip

    Download email-validation-cognito-forms.zip from the guide. It holds cognito-forms-guard.html, relay.mjs and the licence.

  2. Paste the snippet

    On the page that embeds the form, paste cognito-forms-guard.html below the embed code and fill in the Email field’s name and your browser key.

  3. Add a status field

    Add a Textbox field for the result and note its JSON name, as Developer Mode shows it.

  4. Deploy the relay

    Deploy relay.mjs to Cloudflare with EV_API_KEY, COGNITO_API_KEY, RELAY_TOKEN and STATUS_FIELD, then turn on Post JSON Data to a Website in the form’s Settings with the relay’s address as the Submit Entry Endpoint.

  5. Test it

    On a form that sends that address no email, enter no_mailbox@sandbox.email-validation.org: the snippet shows its message and the form stays, at no cost.

Good to know.

  • The snippet stops the form only on a result it has: a slow or failed check, valid and unknown addresses never stop it, and catch_all only if you add it.

  • The key in the snippet sits in the page, so it must be a browser key: it can only validate addresses, only from the origins you list, up to its daily cap. With any other key the snippet checks nothing.

  • Cognito Forms has stored an entry when it posts it, so the relay tags it rather than refusing it; it writes only the status field and never deletes an entry.

  • Act on the action rather than the status: spam traps and known complainers are valid with the action remove.

  • The snippet takes https://api-eu.email-validation.org and the relay EV_REGION=eu to have addresses validated in the EU and only their results stored there.

  • It has not run against a real Cognito Forms account yet: it is built from Cognito Forms’ public documentation and tested against stand-ins in memory. Try it on a test form first.

Connect Cognito Forms.

Test it on our sandbox addresses for free, then on your own contacts.

Create your accountRead the full setup guide

Updated · Maintained by: Email Validation LLC