Marketing & Sales · Tip

Python Email Permutation & Verification Script

Find valid corporate email addresses by testing permutations against a verification API

This technique combines programmatic email permutation generation with an email verification API in Python. Given a first name, last name, and domain, the script cycles through standard corporate patterns and stops once an address tests reachable. It allows you to discover direct contact emails without relying on expensive B2B lead databases.

How it works

Logic demonstrated in Python:

  1. Input: first_name, last_name, domain (e.g., 'Grant', 'Cardone', 'cardonecapital.com').
  2. Call generate_emails(first_name, last_name, domain) to produce common corporate email permutations (first.last@, f.last@, first@, etc.).
  3. Loop through generated emails and call check_email(email), which sends a POST request with {'email': email} to an email verification endpoint/API.
  4. Check if response.get('is_reachable') == 'safe'. If safe, save the response and break the loop to avoid unnecessary API calls.
  5. Output the result into a JSON log containing deliverability, MX records, and SMTP connection data (e.g., is_catch_all, is_deliverable).

What it's for

  • Find direct business email addresses for executive prospects
  • Verify corporate email deliverability before sending cold outreach
  • Reduce reliance on paid lead enrichment databases like Apollo or Hunter

Key points

  • Generate common corporate email permutations from first name, last name, and company domain
  • Send POST requests to an email validation API to check reachability
  • Check deliverability, MX records, and SMTP connection status in JSON responses
  • Break permutation loops immediately upon finding a 'safe' address to conserve API credits
  • Flag disposable addresses, role-based accounts, and catch-all domains

Pricing

Free DIY script; requires a third-party email verification API key

Details

Type
Tip
Category
Marketing & Sales
Topic
Lead Generation
Open source
No
Platforms
Command line
For
Developers, sales engineers, and growth marketers doing cold outreach
Alternative to
Hunter.io, Apollo.io, Anymail Finder, NeverBounce
Tags
email verification, lead generation, python, cold outreach, smtp

Why it was saved

  • @itsmikepowers, 1 July 2024: Enables finding and verifying executive business email addresses without paying for expensive cold outreach databases like Apollo or Hunter.

Compare

Related

All 22 in Lead Generation →

Updated