# deep-email-validator

> Validates emails based on regex, common typos, disposable email blacklists, DNS records and SMTP server response.

Latest version **0.1.27** (published 2026-04-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install deep-email-validator
pnpm add deep-email-validator
yarn add deep-email-validator
bun add deep-email-validator
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; high maintenance score; high quality score.

Warnings: low downloads; large bundle; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.1.27 |
| Published | 2026-04-21 |
| First published | 2020-03-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=20 |
| Dependencies | 2 |
| Unpacked size | 12.5 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 928 |
| Author | David Alberto Adler |
| Maintainers | mfbx9da4 |
| Keywords | email-validation, email-typos, email-regex, disposable-emails, smtp, mx-records |

## Links

- npm: https://www.npmjs.com/package/deep-email-validator
- Repository: https://github.com/mfbx9da4/deep-email-validator
- Homepage: https://github.com/mfbx9da4/deep-email-validator#readme
- Issues: https://github.com/mfbx9da4/deep-email-validator/issues
- npm.io page: https://npm.io/package/deep-email-validator

## Dependencies (2)

- [mailcheck](https://npm.io/package/mailcheck.md) ^1.1.1
- [disposable-email-domains](https://npm.io/package/disposable-email-domains.md) ^1.0.62

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 0.1.27 (latest) — 2026-04-21
- 0.1.26 — 2026-04-21
- 0.1.25 — 2026-04-21
- 0.1.24 — 2026-04-21
- 0.1.23 — 2026-04-21
- 0.1.21 — 2021-12-21
- 0.1.20 — 2021-12-20
- 0.1.19 — 2021-12-20
- 0.1.18 — 2020-11-09
- 0.1.17 — 2020-05-14
- 0.1.16 — 2020-03-27
- 0.1.15 — 2020-03-16
- 0.1.14 — 2020-03-16
- 0.1.13 — 2020-03-13
- 0.1.12 — 2020-03-11
- … 12 more at https://npm.io/package/deep-email-validator/versions

## README

# deep-email-validator

Validates email addresses based on regex, common typos, disposable email blacklists, DNS records and SMTP server response.

- Validates email format (contains `@`, `.` in domain, no spaces or control characters).
- Validates common typos e.g. `example@gmaill.com` using [mailcheck](https://github.com/mailcheck/mailcheck).
- Validates email was not generated by a disposable email service using [disposable-email-domains](https://github.com/ivolo/disposable-email-domains).
- Validates MX records are present on DNS.
- Validates SMTP server is running.
- Validates mailbox exists on SMTP server.
- Sanitizes inputs to prevent SMTP command injection.
- Native TypeScript support.

## Getting Started

Requires Node.js >= 20. Server-side only (not browser compatible).

### Installation

```
npm install deep-email-validator
```

### Usage

```typescript
import { validate } from 'deep-email-validator'

const res = await validate('asdf@gmail.com')
// {
//   "valid": false,
//   "reason": "smtp",
//   "validators": {
//       "regex": {
//         "valid": true
//       },
//       "typo": {
//         "valid": true
//       },
//       "disposable": {
//         "valid": true
//       },
//       "mx": {
//         "valid": true
//       },
//       "smtp": {
//         "valid": false,
//         "reason": "Mailbox not found.",
//       }
//   }
// }
```

You can also pass an options object to control which validations run:

```typescript
await validate({
  email: 'name@example.org',
  sender: 'name@example.org',
  validateRegex: true,
  validateMx: true,
  validateTypo: true,
  validateDisposable: true,
  validateSMTP: true,
})
```

[Default options can be found here.](https://github.com/mfbx9da4/deep-email-validator/blob/main/src/options/options.ts#L1)

### Custom TLDs

If you want to validate domains with TLDs that are not supported by default, use the `additionalTopLevelDomains` option:

```typescript
await validate({
  email: 'name@example.ir',
  additionalTopLevelDomains: ['ir'],
})
```

For a list of TLDs supported by default, see [mailcheck defaults](https://github.com/mailcheck/mailcheck/blob/afca031b4ce1cdc6e3ecbe88198f41b4835f81e3/src/mailcheck.js#L31).

<details>
<summary>CommonJS usage</summary>

```javascript
const { validate } = require('deep-email-validator')

const res = await validate('asdf@gmail.com')
```

</details>

---
_Source: https://npm.io/package/deep-email-validator · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
