Use Bulk Email Deliverability & SMTP Verification with Python
Check email addresses for syntax, MX records, disposable and role-based domains, and optionally SMTP mailbox existence and catch-all behavior, with a verdict and confidence score per address.
1. Choose the data you need
Review the published README for supported collection modes, examples, and limits. The recipe below uses the current published input definition.
2. Prepare a source-based input
This JSON contains published prefills and required-field defaults. Review every value for your task before running it; it is not a promise of successful collection.
{
"checkCatchAll": false,
"checkSmtp": false,
"concurrency": 10,
"datasetEmailField": "email",
"emails": [
"test@gmail.com"
],
"includeDomainHealth": true,
"includeSourceFields": false,
"maxEmails": 10000,
"maxEmailsPerDomain": 100,
"maxRetries": 2,
"smtpTimeout": 10,
"verificationDepth": "basic"
}
Download input.example.json and save your reviewed copy as input.json.
| Field | Type | Required | Description |
|---|---|---|---|
emails | array | optional | One email address per item. You can paste a list here or use the text box below; if both are filled, the actor verifies both. Duplicates are removed case-insensitively. |
emailsText | string | optional | Paste a list separated by new lines, commas, semicolons or spaces. Useful for CSV exports and email lists. |
datasetId | string | optional | Optional Apify dataset ID. The actor reads one email per item from datasetEmailField, verifies those addresses, and can carry the original columns into each record. |
datasetEmailField | string | optional | Column name that holds the email address when datasetId is set. |
includeSourceFields | boolean | optional | When reading from a dataset, include the original row in sourceData so you can join the verification result back to your CRM export. |
verificationDepth | string | optional | Basic checks syntax, MX records and the A/AAAA fallback. Standard adds disposable, role-based, free-provider and domain-health checks. Deep adds a best-effort SMTP mailbox probe and catch-all detection. |
concurrency | integer | optional | How many addresses are checked in parallel. Higher is faster, but mail servers may rate-limit SMTP probes. |
maxEmails | integer | optional | Upper bound on unique addresses to verify in one run. Anything beyond this is skipped and reported in the run summary. |
maxEmailsPerDomain | integer | optional | Cap on addresses verified for the same domain. Extra addresses get an 'unknown' record explaining the cap instead of hammering one mail server. |
smtpTimeout | number | optional | Connect and response timeout for each SMTP probe. Use a lower value for fast scans and a higher value for slow mail servers. |
maxRetries | integer | optional | Extra attempts for temporary DNS, connection and SMTP 4xx failures, using exponential backoff. |
checkSmtp | boolean | optional | Run the best-effort SMTP mailbox probe even at basic or standard depth. Deep depth already includes it. |
checkCatchAll | boolean | optional | Probe a random address to detect catch-all domains. Implies SMTP probing. Deep depth already includes it. |
includeDomainHealth | boolean | optional | Add SPF, DMARC policy and common DKIM selector findings for each domain at standard or deep depth. |
3. Start an Actor run
Set APIFY_TOKEN in your environment. Python 3.10 or newer is sufficient; this recipe uses no third-party packages.
Execution may incur charges. Review current pricing on Apify. The request asks for a 120-second timeout and a charge limit; these settings are subject to Apify’s pricing and do not guarantee an all-inclusive spending cap.
import json
import os
import urllib.request
# Save the schema-derived example as input.json; review and edit it first.
with open("input.json", encoding="utf-8") as stream:
actor_input = json.load(stream)
token = os.environ["APIFY_TOKEN"]
request = urllib.request.Request(
"https://api.apify.com/v2/acts/9RiemV8vYMg3CcH3S/runs?timeout=120&maxTotalChargeUsd=0.50",
data=json.dumps(actor_input).encode("utf-8"),
headers={"Authorization": "Bearer " + token, "Content-Type": "application/json"},
method="POST",
)
# This starts a potentially billable run. Do not automatically retry this POST.
with urllib.request.urlopen(request, timeout=40) as response:
run = json.load(response)["data"]
print("Run ID:", run["id"])
print("Status:", run["status"])
# Inspect and download results in Apify Console once the run succeeds.
4. Inspect the actual results
Open the run in Apify Console and wait for a successful completion. Use the published output schema to locate results and the dataset schema to understand declared views. Missing or optional record fields must not be treated as guaranteed values.
One record per unique email address with verdict, confidence, checks that actually ran, MX and provider details, typo suggestion, alias flags, SMTP response details, catch-all confidence, domain health and a recommended next action.
Questions before you run
Which inputs are required?
No top-level fields are marked required in the published schema. Conditional requirements can still apply; check the README.
What does this guide verify?
The fields, prefills, and schema links are rendered from the published build. This is a usage recipe, not a paid live extraction test. Source availability and collection results can vary.
What if the run request times out?
Check Apify Console before retrying. The first request may already have created a run. Do not automatically repeat a run-creation POST.
Generated from source build 3Q4ZEsXfpGej1x96y and its README and schemas. Source changes regenerate this guide; no third-party editorial claims are inferred.