https://github.com/bcomnes/resolve-email
https://github.com/bcomnes/resolve-email
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/bcomnes/resolve-email
- Owner: bcomnes
- License: mit
- Created: 2023-07-20T00:40:33.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2025-04-21T16:18:03.000Z (about 1 year ago)
- Last Synced: 2025-04-21T16:21:31.530Z (about 1 year ago)
- Language: JavaScript
- Size: 696 KB
- Stars: 10
- Watchers: 3
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- Funding: .github/funding.yml
- License: LICENSE
Awesome Lists containing this project
README
# resolve-email
[](https://www.npmjs.com/package/resolve-email)
[](https://github.com/bcomnes/resolve-email/actions)
[](https://coveralls.io/github/bcomnes/resolve-email?branch=master)
[](https://github.com/voxpelli/types-in-js)
[](https://npmtrends.com/resolve-email)
[](https://socket.dev/npm/package/resolve-email)
Resolve the domain of a syntactically valid email address to see if there is even a chance of deliverability. Also checks against a large list of disposable email and other junk/unwated address domains and rejects those.
It also checks the email address against the (updated) [zod reasonable email regex](https://colinhacks.com/essays/reasonable-email-regex) and filters out unreasonable email addresses.
```
npm install resolve-email
```
## Usage
``` js
import { resolveEmail } from 'resolve-email'
// Validate the email address before passing it in here:
const results = await resolveEmail('person@gmailc.om')
console.log(results)
// results.emailResolves true/false
// results.mxRecords [array of mx records and priorities]
// results.error any errors that may have occurred.
```
## See also
This module was adapted from [nodemailer/nodemailer-direct-transport](https://github.com/nodemailer/nodemailer-direct-transport/blob/v3.3.2/lib/direct-transport.js#L438)
The disposable email domain list is generated from the following data sources:
- https://github.com/romainsimon/emailvalid
- https://github.com/disposable-email-domains/disposable-email-domains
## License
MIT