Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/playcode/does-email-exist
Does email exist?
https://github.com/playcode/does-email-exist
Last synced: 7 days ago
JSON representation
Does email exist?
- Host: GitHub
- URL: https://github.com/playcode/does-email-exist
- Owner: playcode
- License: mit
- Created: 2022-02-11T00:16:52.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2023-04-23T11:59:54.000Z (over 1 year ago)
- Last Synced: 2024-11-02T00:48:26.965Z (11 days ago)
- Language: TypeScript
- Size: 86.9 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Does Email Exist
- Validates SMTP server is running.
- Validates MX records are present on DNS.
- Validates email looks like an email i.e. contains an "@" and a "." to the right of it.
- Validates common typos e.g. [email protected] using [mailcheck](https://github.com/mailcheck/mailcheck).
- Validates email was not generated by disposable email service using [disposable-email-domains](https://github.com/ivolo/disposable-email-domains).
- Validates mailbox exists on SMTP server.## About us
The #1 [Javascript compiler](https://playcode.io/javascript-compiler) to write, compile and run JavaScript online. Perfect for learn and prototype javascript online. Easy to use.## Getting Started
Compatible with node.js only. Not browser ready.
```
npm i does-email-exist --save
```Usage
```typescript
import validate from 'does-email-exist'
const main = async () => {
let res = await validate('[email protected]')
// {
// "valid": false,
// "reason": "smtp",
// "validators": {
// "regex": {
// "valid": true
// },
// "typo": {
// "valid": true
// },
// "disposable": {
// "valid": true
// },
// "mx": {
// "valid": true
// },
// "smtp": {
// "valid": false,
// "reason": "553-mail rejected because your IP is in the PBL.",
// "code": 553
// }
// }
// }// Can also be called with these default options
await validate({
email: '[email protected]', // Recipient
sender: '[email protected]', // Your correct email address
helloName: 'localhost',
validateRegex: true,
validateMx: true,
validateTypo: false,
validateDisposable: true,
validateSMTP: true,
})
}
```[Based on deep-email-validator](https://github.com/mfbx9da4/deep-email-validator)
LICENSE: MIT.