# ping-email

By **getpingback** · Software & Tools

Open-source Node.js SMTP email verification library for developers who need programmatic, multi-layer address validation with detailed reason codes.

- Source: https://github.com/getpingback/ping-email
- Repository: https://github.com/getpingback/ping-email
- Install: `npm i ping-email`
- Tags: open-source, node.js, email, smtp, cli, typescript, mit-license, email-validation
- Pricing: free
- Upvotes: 0

## Features

- Three-layer validation: syntax, MX record lookup, and live SMTP handshake
- 14 named response message codes for granular failure diagnosis
- Disposable email address detection
- Configurable port, FQDN, sender, timeout, and retry attempts
- ignoreSMTPVerify flag to skip SMTP probe (syntax + MX only)
- Debug mode with verbose SMTP session logging
- Bulk CSV verification via bundled CLI script with concurrency controls
- MIT-licensed TypeScript source with Jest test config included

---

## Why it matters
Sending to bad addresses burns deliverability, wastes server resources, and invites fraud. ping-email catches invalid addresses before the send, using a real SMTP handshake rather than a regex alone, so bad addresses are flagged at the source.

## The big picture
ping-email is a Node.js library, licensed MIT, from the Pingback team. It layers three checks in sequence: syntax validation, DNS MX record lookup, and a simulated SMTP conversation with the recipient's mail server. Each step has its own exit code, so your application knows exactly why an address failed, not just that it did.

## How it works
Instantiate `PingEmail` with your SMTP config (port, FQDN, sender address, timeout, retry count), then call `ping(email)`. The response object carries `email`, `valid`, `success`, and a `message` string drawn from 14 named constants, covering scenarios from `"Invalid email syntax"` to `"Disposable email is not allowed"` to `"Connection timeout"`. The `ignoreSMTPVerify` option skips the live SMTP probe when you only need syntax and MX validation.

## Zoom in
The built-in CLI script (`scripts/filter-valid-csv-emails.ts`) reads a CSV with an `email` column, runs each address through `PingEmail`, and writes a second CSV containing only rows where `valid` is `true`. Concurrency, pacing, and the `--ignore-smtp` flag are all configurable via command-line arguments, per the README.

## Yes, but
SMTP probing carries a real IP-blocking risk. Recipient mail servers can flag frequent verification attempts as suspicious and block your IP. The README recommends rate limiting, proxy distribution, or a dedicated IP for high-volume runs. Skipping SMTP with `ignoreSMTPVerify` reduces that risk but also reduces accuracy.

## The bottom line
ping-email is the right pick when you need programmatic, in-process email verification with granular failure reasons and the flexibility to tune aggressiveness per environment. It is not a managed SaaS API, so your infrastructure is responsible for reputation management at scale.

## FAQ

### What is ping-email?

ping-email is an open-source Node.js library for programmatic email address verification. It validates addresses through three sequential layers: syntax checking, DNS MX record lookup, and a live SMTP handshake with the recipient's mail server. Each check produces a named result code, so callers know exactly why an address passed or failed, not just the boolean outcome. It is published under the MIT license by the Pingback team.

### How do I install and use ping-email?

Install via npm (`npm install ping-email`) or Yarn (`yarn add ping-email`). Instantiate `PingEmail` with your SMTP options (port, FQDN, sender address, timeout in milliseconds, and number of retry attempts), then call `await pingEmail.ping('user@example.com')`. The response object returns `email`, `valid`, `success`, and a `message` string from the library's named message constants. A bundled CLI script (`npm run filter-csv`) can also process a CSV file in bulk and output a filtered file of valid addresses.

### Is ping-email free or open-source?

Yes, ping-email is fully open-source and licensed under the MIT License, copyright 2024-present Pingback. There are no API fees or usage tiers. You run the library inside your own Node.js environment using your own SMTP infrastructure, so all costs (server, IP reputation management) are yours to manage.

### What is ping-email best for?

ping-email is best for backend services that need in-process email validation before persisting user records, and for teams cleaning bulk contact lists using the built-in CSV CLI script. It excels when you need 14 granular failure reason codes (covering syntax, domain, MX, disposable-email detection, SMTP timeouts, and more) to drive different application behavior per failure type. It is a strong fit for self-hosted stacks where you want no third-party API dependency.

### How does ping-email compare to a managed email verification API?

ping-email runs entirely in your own Node.js process with no external SaaS dependency, which means zero per-lookup fees and full control over the code. Managed APIs, by contrast, handle IP reputation, proxy rotation, and uptime on your behalf, making them safer for high-volume bulk verification. The README explicitly flags that frequent SMTP probes from a single IP can trigger blocking by recipient mail servers, a problem managed services absorb for you. Choose ping-email when self-hosting and low cost matter more than managed IP reputation.

### What are the main limitations or risks of using ping-email?

The primary risk is IP blocking: recipient mail servers can flag repeated SMTP verification attempts as suspicious and block your IP, especially at high volume or frequency. Many cloud providers (AWS, GCP, Azure) also block outbound port 25 by default, which is the library's default SMTP port. The `ignoreSMTPVerify` option reduces blocking risk by skipping the live SMTP probe, but sacrifices mailbox-level accuracy. The library simulates an SMTP conversation; it cannot guarantee that a mailbox will actually accept a real message.

---
[View on Analog](https://analoghq.ai/getpingback/software-tools/ping-email)