If spam, typos, and bogus email addresses keep clogging your forms, you're not alone. Most web forms are magnets for junk — and that means wasted time, bad data, and sometimes, flat-out embarrassment. If you want a simple, real-time way to check email addresses before they hit your database, Neverbounce is one of the better tools out there. This guide walks you through hooking it up to your web form, step by step, with zero fluff or sales pitches.
Whether you’re a developer, a marketer wrangling landing pages, or just someone tired of cleaning up email lists, this is for you.
1. Why bother with real-time email verification?
Let’s get this out of the way: you don’t have to verify emails in real time. But if you care about:
- Getting real people, not bots or junk
- Avoiding hard bounces and blacklists
- Saving yourself from cleaning up messy lists later
…it’s a smart move.
Not every business needs this. If you’re running a simple contact form, it might be overkill. But for signups, newsletters, or anything where you need to reach people reliably, it’s worth the trouble.
2. How Neverbounce works (and what it can’t do)
Neverbounce checks if an email address is valid before it’s saved. It pings the mail server and tells you if the address is real, disposable, or just plain fake. That said:
- It’s not magic. It can’t verify if someone actually owns an email, just if it exists and can get mail.
- It won’t stop all spam. Determined bots can still sneak through if you don’t have other protections (like CAPTCHAs or rate limits).
- It has a cost. Neverbounce charges per verification, so don’t waste checks on throwaway forms.
3. What you’ll need
Before you start, make sure you’ve got:
- A Neverbounce account with API access (free trial is fine for testing).
- A web form (plain HTML, React, Vue—doesn’t matter).
- Access to edit your site’s frontend code.
- (Optional) A backend if you want to verify emails server-side, but this guide covers client-side (in-browser) setup.
4. Step-by-step: Setting up real-time email verification
Step 1: Get your Neverbounce API key
- Log in at Neverbounce.
- Go to API in the dashboard menu.
- Copy your API key — you’ll need it soon.
Pro tip: Don’t put your secret key in frontend code; use the “Public API Key” for client-side checks.
Step 2: Decide: Client-side or server-side verification?
- Client-side (checks in the browser): Fast, easy, but exposes your API key. Use Neverbounce’s widget or public API for this.
- Server-side (checks on your server): More secure, but needs backend code.
For most web forms, client-side is fine — unless you’re handling sensitive data or need to hide your API key.
Step 3: Add Neverbounce’s widget (the easiest way)
If you want to get going fast, the Neverbounce widget is the simplest approach. It’s a small snippet of JavaScript that plugs right into your form.
a. Include the widget script
Add this to your <head>
or just before the closing </body>
tag:
html
b. Add a data-nb
attribute to your form
Mark your email field with data-nb
:
html
c. Initialize the widget
Add this script after your form:
html
Replace "YOUR_PUBLIC_API_KEY"
with your actual public API key.
d. Test it out
- Enter a fake or obviously invalid email.
- Try submitting the form.
- If it’s working, you’ll see an error and the form won’t submit.
What’s good:
- Fast setup
- No backend needed
- Handles most cases
What’s not:
- If someone disables JavaScript, they skip the check.
- Exposes your public API key (not a huge risk, but not ideal for high-security apps).
Step 4: Roll your own (using the Neverbounce API directly)
Want more control? Use the Neverbounce API with your own JavaScript.
a. Basic AJAX call example
Here’s a simple way to call Neverbounce’s API from the browser using fetch
:
javascript
async function verifyEmail(email) {
const apiKey = "YOUR_PUBLIC_API_KEY";
const response = await fetch(
https://api.neverbounce.com/v4/single/check?key=${apiKey}&email=${encodeURIComponent(email)}
,
{ method: "GET" }
);
const data = await response.json();
return data.result; // "valid", "invalid", "disposable", etc.
}
// Example usage: document.querySelector('form').addEventListener('submit', async function(e) { e.preventDefault(); const email = document.getElementById('email').value; const result = await verifyEmail(email); if (result !== "valid") { alert("Please enter a valid email address."); return; } this.submit(); // or handle form data here });
Heads up:
- The public API key is rate-limited and meant for client-side use only. Don’t use secret keys here.
- Neverbounce limits how many free checks you can do per month.
Step 5: Server-side verification (optional, but safer)
If you want to keep your API key hidden or need to guarantee checks, verify emails on your server. Here’s the broad idea:
- On form submit, POST the email to your backend.
- Your backend (Node, PHP, Python—whatever) calls Neverbounce’s API with the private key.
- Return the result to the frontend and handle accordingly.
When to use this:
- You’re handling sensitive signups (like payments or private accounts).
- You need to log results or block repeat offenders.
Otherwise, for most marketing forms, client-side is enough.
5. What to watch out for
No tool’s perfect. Here’s the reality check:
- False negatives happen. Some legit addresses (especially new or rare domains) can get flagged as “unknown.” Don’t block users on these — let them try again or submit anyway.
- Disposable email detection is good, not perfect. New throwaway domains pop up all the time.
- Don’t annoy your users. If someone mistypes once, give them a clear error, not a “go away” message.
- Privacy matters. Neverbounce will see every address you send. That’s fine for most, but think twice if you’re in a regulated industry.
6. What not to waste time on
- Don’t try to block all fake emails. You’ll never win. Focus on cutting out the obvious junk.
- Don’t rely on Neverbounce alone for security. Pair with other checks (like CAPTCHA) to stop bots.
- Don’t make your form painful. Too many hoops and people will just leave.
7. If you run into trouble
- API errors? Double-check your key, and make sure you’re using the public key on the frontend.
- Form won’t submit? Make sure your validation is returning the right result, and that you’re not accidentally blocking good emails.
- Still getting junk? Combine Neverbounce with double opt-in emails or other filters.
Keep it simple (and keep tweaking)
The goal isn’t perfection — it’s to stop most bad emails without annoying your real users. Start with the basics, watch what slips through, and adjust. Neverbounce is a solid tool, but not a silver bullet, so don’t stress about catching every single fake. Set it up, see how it works, and tweak as needed. Your forms (and your sanity) will thank you.