π« The Pain Point
You send a marketing campaign to 1,000 users, but 30% bounce back because of bad emails: gmail.com.vn, gmai.com, yahoo@123.
Mailchimp or SendGrid will ban your account if your bounce rate is too high. You need to scrub the list first.
π Agentic Solution
A 3-Layer Filter: Syntax (Format) -> Domain (Real website) -> MX Record (Mail server exists).
Key Features:
- Regex Check: Eliminates obvious typos like
@gmai.com. - MX Check: (Advanced) Pinngs the DNS to see if the domain actually accepts emails.
βοΈ Phase 1: Commander (Quick Fix)
For basic cleanup.
Prompt:
βI have an
emails.txtfile. Write a script to check the syntax of each email using Regex. Remove invalid formats (missing @, missing dot). Save valid emails tovalid_emails.txt.β
Result: A clean text file.
ποΈ Phase 2: Architect (Permanent Tool)
For Professional Marketers.
Engineering Prompt:
**Role:** Python Network Developer
**Task:** Create an "Email List Cleaner" App.
**Requirements:**
1. **GUI:**
* Select Input CSV/Excel.
* Select Column containing Emails.
* "Validate" button.
2. **Logic:**
* **Level 1 (Syntax):** Use robust Regex to check structure.
* **Level 2 (Domain):** Check if domain resolves to an IP.
* *Optional Level 3 (MX):* Use `dnspython` to check MX records.
* Tag each row: 'Valid', 'Invalid Syntax', or 'Invalid Domain'.
3. **Deliverables:** `email_validator.py`, `run.bat` (Windows), `run.sh` (Mac).
π§ Prompt Decoding
- MX Record: Checks if the βhouseβ actually has a mailbox. Many emails look correct (
user@fake-domain.com) but the domain doesnβt exist. Checking MX records prevents these βsoft bouncesβ.
π οΈ Instructions
- Copy Prompt -> Paste -> Run.
- Select Excel -> Validate -> Filter invalid rows.