Integrations · Sales outreach
Validate your QuickMail leads
Check the email addresses of your QuickMail leads and write each result into four lead custom properties, so each lead shows whether its address is worth mailing. A script you run on your own computer reads the leads of one workspace, checks the addresses as one bulk list and writes the results back. It never deletes a lead, changes its address, tags it or touches a campaign. Download it: email-validation-quickmail.zip holds quickmail.mjs (the script) and the MIT licence.
What you need
- A computer with Node 22.18 or later. Nothing to install: the script has no dependencies.
- An API key of ours from the API keys page with Validate addresses, and the permission Bulk lists (off by default: turn it on when you create the key) for more than 50 leads.
- A QuickMail API key. QuickMail's API is on its Growth and Agency plans, not Starter. A team account: Settings → Integrations → under API keys, Create API Key. An agency account: the agency dashboard (click the organization name at the top left) → Settings → General → Create API key. You can create one for the script alone.
Try it free first
Every checked address uses one credit, so try it on a workspace that holds only test leads, never on your real ones. Give one test lead the address no_mailbox@sandbox.email-validation.org (sandbox checks are free; that domain receives no mail, so send it nothing), then:
cd email-validation-quickmail # the unzipped folder
export QUICKMAIL_API_KEY=… EV_API_KEY=… QUICKMAIL_WORKSPACE_ID=…
node quickmail.mjs --dry-run # creates nothing, checks nothing, writes nothing: only counts
node quickmail.mjs # creates the four custom properties if missing, checks and writesThe lead's ev_status custom property says invalid and ev_reason says no_mailbox. Run it once more: it reports nothing to check, because every result was written. Then delete the test lead.
Run it
node quickmail.mjs --dry-run # how many leads would be checked; free
node quickmail.mjs # checks and writesQUICKMAIL_WORKSPACE_ID is the id of the workspace to check (QuickMail's API answers it). Leave it unset when the key reaches one workspace; a key that reaches several stops before anything is checked and prints their ids. Up to 50 addresses are checked one by one; more go out as one bulk list. A lead whose address already has a result is skipped (an unknown result is checked again), so a daily run checks only new and changed addresses. If a run stops, run the same command again from the same folder: it resumes the same bulk list and never pays twice (within the 30 days a list is kept). The state file (.ev-quickmail-<workspace id>.json) lives in that folder. It prints ids and counts, never an address or a key.
QuickMail allows 10 API requests every 10 seconds, so the script sends one a second, about two per lead it writes: a workspace of thousands of leads takes hours. If QuickMail still refuses for its rate limit, the script stops; run the same command again, which resumes without paying twice.
Options:
--region eu: checked in the EU, lists and results kept there, with the same key.--revalidate: check again addresses that already have a result.--state FILE: a state file of your own choosing.
Exit codes: 0 done; 1 a write failed or the run stopped (run it again: nothing is paid twice); 2 wrong options; 75 the bulk list was still being checked when the script stopped waiting (run it again later to collect it).
What it writes
Four lead custom properties, created by the first run when they are missing (you can create them in QuickMail first, with exactly these names):
| Custom property | Holds |
|---|---|
ev_status | valid, invalid, catch_all, unknown or disposable |
ev_reason | the reason, for example no_mailbox or accepted |
ev_checked_at | when it was checked |
ev_address_hash | a hash of the address the result belongs to, so a changed address is checked again |
Spam traps and complainers are valid with a warning reason: see what each status means. Each result is written by lead id, and only while the lead still holds the address that was checked; the write sets only these four custom properties, so the lead's other fields stay as they are. The first write of a run is read back: if anything else of that lead changed, the script stops there and says so. A result that could not be written is kept in a file next to the state file and written by the next run without a new check.
Each lead shows its ev_status among its custom properties. QuickMail cannot filter leads on a custom property (its help says so), so look for invalid and disposable on the leads you plan to mail.
End the access
Delete the QuickMail API key where you created it, and our key on the API keys page. The four custom properties stay on your leads until you delete them in QuickMail.