Validate email addresses by checking syntax, MX records, and domain configuration. Verify deliverability before sending.
Email validation with MX (Mail Exchanger) lookup verifies that an email address is both syntactically correct and associated with a domain that can actually receive mail. While regex-based validation checks the format, MX lookup queries DNS to confirm that the domain has mail server records configured—providing a much stronger signal that the address is deliverable.
This two-layer approach catches issues that syntax checks miss: typo domains (gmial.com instead of gmail.com), expired domains with no mail infrastructure, and disposable email services. For organizations sending transactional emails, marketing campaigns, or security notifications, validating email addresses reduces bounce rates, protects sender reputation, and improves deliverability.
Email validation involves multiple stages, each catching different classes of invalid addresses:
Stage 1 — Syntax validation: Checks that the address matches RFC 5321 format: a local part, the @ symbol, and a domain. The local part can include letters, numbers, dots, and certain special characters. The domain must be a valid hostname.
Stage 2 — Domain DNS lookup: Queries DNS for the domain's MX records. MX records specify which mail servers accept email for that domain, along with priority values. If no MX records exist, the validator falls back to checking for an A record (some domains accept mail on their primary host).
Stage 3 — MX record analysis: Evaluates the returned mail servers. Major providers like Google Workspace (aspmx.l.google.com), Microsoft 365 (*.mail.protection.outlook.com), and Zoho use recognizable MX patterns. Disposable email services and known spam domains can be flagged at this stage.
| Validation Level | What It Checks | Catches |
|---|---|---|
| Syntax only | Format, @ symbol, domain structure | Obvious typos, missing @ |
| DNS/MX lookup | Domain exists, has mail servers | Dead domains, typo domains |
| SMTP verification | Server accepts recipient | Non-existent mailboxes |
| Disposable detection | Known temporary email providers | Throwaway addresses |