Email verification for signup forms
Verify the address on your server when the form is submitted: reject addresses that can't receive mail and throwaway inboxes, suggest fixes for typos, and let everything uncertain through. Done right, real users never notice the check.
What signup verification is for
A bad address at signup costs more than a row in a database. The confirmation email never arrives, the person can't log in or reset a password, and support hears about it. Fake and throwaway signups use up free-tier resources, and every bounce from your welcome emails counts against the domain your product mail is sent from.
Checking at the door stops most of it: misspelled domains (invalid_domain), mailboxes that don't exist (mailbox_not_found) and temporary inboxes (disposable). The trick is doing it without making real users wait, or turning them away by mistake.
Where the check fits in a signup
- 01
Format check in the browser
An email input and a loose regex catch malformed addresses instantly, with no API call. See /guides/email-validation-javascript.
- 02
Submit to your backend
Your API key lives on your server. Never call MailVet from browser or mobile code.
- 03
Verify with a short timeout
Call
GET /v1/verifywithtimeout=5. Most addresses come back in a couple of seconds. - 04
Reject only what's definitely bad
Undeliverable and disposable addresses get a clear message. Everything else goes through.
- 05
Finish the rest later
A
pendingresult goes through too. Store its id and update the account when theverification.completedwebhook arrives.
A sensible policy for each result
| Result | Reason | At signup | What to tell the user |
|---|---|---|---|
| deliverable | accepted, catch_all_verified | Accept | Nothing |
| undeliverable | invalid_domain | Reject | That domain doesn't receive email. Check for typos. |
| undeliverable | mailbox_not_found, catch_all_no_mailbox | Reject | This address can't receive email. |
| undeliverable | invalid_syntax | Reject | Enter a valid email address. |
| risky | disposable | Reject, or limit the account | Please use a permanent email address. |
| risky | mailbox_full | Accept and flag | Nothing |
| unknown | no_response, catch_all_unresolved | Accept | Nothing |
| pending (HTTP 202) | None yet | Accept; finish by webhook | Nothing |
| Timeout or API error | None | Accept and log it | Nothing |
Example: verification inside a signup handler
Pydantic's EmailStr handles syntax before any API call. The client timeout sits a few seconds above the API's timeout=5, and every failure path lets the user in. Node, PHP and browser versions are in the /guides/email-validation-node, /guides/email-validation-php and /guides/email-validation-javascript guides.
import os
import httpx
from fastapi import FastAPI, HTTPException
from pydantic import BaseModel, EmailStr # EmailStr needs: pip install "pydantic[email]"
app = FastAPI()
mailvet = httpx.AsyncClient(
headers={"Authorization": "Bearer " + os.environ["MAILVET_KEY"]},
timeout=httpx.Timeout(8.0, connect=3.0),
)
REJECT = {
"invalid_syntax": "Enter a valid email address.",
"invalid_domain": "That domain doesn't receive email. Check for typos.",
"mailbox_not_found": "This address can't receive email. Check for typos.",
"catch_all_no_mailbox": "This address can't receive email. Check for typos.",
"disposable": "Please use a permanent address, not a temporary inbox.",
}
class Signup(BaseModel):
email: EmailStr # syntax check, before any API call
password: str
@app.post("/signup", status_code=201)
async def signup(form: Signup):
v = None
try:
r = await mailvet.get(
"https://api.mailvet.app/v1/verify",
params={"email": form.email, "timeout": 5}, # answer within 5 s, or "pending"
)
r.raise_for_status()
v = r.json()
except httpx.HTTPError:
pass # timeout, network error or API error: don't block a real person
if v and v["status"] == "done" and v["reason"] in REJECT:
raise HTTPException(status_code=422, detail=REJECT[v["reason"]])
user = await create_user( # your own persistence
email=form.email,
password=form.password,
email_status=(v["result"] or "pending") if v else "unchecked",
email_check_id=v["id"] if v else None,
)
return {"id": user.id}Disposable addresses and typos: what to expect
MailVet flags addresses at known throwaway-inbox providers as risky with reason disposable. Whether to block them depends on your product: for free trials and free tiers, usually yes; for a newsletter, maybe not. New disposable domains appear all the time, so treat the flag as a strong filter, not a guarantee.
Typos come in two kinds. A misspelled domain that doesn't exist, like gmial.com, comes back invalid_domain and can be rejected with a hint. A typo in the name part is caught only if the misspelled mailbox doesn't exist; if it happens to belong to someone else, the address genuinely works and no verifier can tell. A "Did you mean…?" hint in the browser and a confirmation email cover that case.
Keep signup fast and fair
- ✓Call MailVet from your backend, with
timeout=5and a client timeout a few seconds longer - ✓Accept
unknownandpendingresults; finish them by webhook - ✓Show a typo hint before the form is submitted
- ✓Reject undeliverable and disposable addresses with a message that says what to fix
- ✓Use a test key (
mv_test_…) in CI so automated signups never spend credits
- ×Calling the API from browser or app code, where the key can be copied
- ×Blocking the signup when the check times out or the API is unreachable
- ×Telling users their address is invalid when the result is only unknown
- ×Rejecting role addresses or free providers without a product reason
Signup verification questions
Will real-time verification slow down my signup form?
Barely. Most checks return in a couple of seconds. Pass timeout=5 so the API never holds the request longer than that, and accept the signup if anything times out.
Should I block disposable email addresses?
It depends on the product. For free trials and free tiers that get abused, usually yes. For a newsletter or a low-stakes signup, you may prefer to accept them and simply not count them as real contacts.
Can I call the verification API directly from the browser?
No. The API key would be visible to anyone who opens your page, and they could spend your credits. Call MailVet from your backend or a serverless function.
What happens with catch-all addresses at signup?
They're verified like any other address. If a catch-all check needs longer than your timeout, the API returns pending; accept the signup and update the account when the webhook delivers the result.
Does every signup cost a credit?
Only signups that get a definite result. Unknown results, invalid syntax and pending checks until they finish are free, and test keys never use credits.
Stop bad signups at the door
Get an API key with 100 free credits and add the check to your signup handler today.
Related
Last updated November 13, 2026