DEV Community

Алексей Спинов
Алексей Спинов

Posted on

Email Validation Without Sending Emails — MX Records, Disposable Detection, Provider ID

You can validate 90% of email addresses without sending a single test email.

4 Checks You Can Do Programmatically

1. Format Check

RFC 5322 regex. Catches typos and malformed addresses.

2. MX Record Lookup

import dns from "dns/promises";
const mx = await dns.resolveMx("company.com");
// If empty → email undeliverable
Enter fullscreen mode Exit fullscreen mode

3. Provider Detection

From MX records:

  • aspmx.l.google.com → Google Workspace
  • *.protection.outlook.com → Microsoft 365
  • *.protonmail.ch → ProtonMail

4. Disposable Domain Check

Maintain a blocklist: mailinator.com, guerrillamail.com, yopmail.com, etc.

Output

{
  "email": "user@company.com",
  "isValidFormat": true,
  "hasMxRecords": true,
  "provider": "Google Workspace",
  "isDisposable": false,
  "verdict": "VALID"
}
Enter fullscreen mode Exit fullscreen mode

Free Email Validator on Apify — search knotless_cadence email-validator.

Top comments (0)