https://github.com/brandon93s/email-chk
Check if an email is real
https://github.com/brandon93s/email-chk
email email-validation email-validator email-verification
Last synced: 8 months ago
JSON representation
Check if an email is real
- Host: GitHub
- URL: https://github.com/brandon93s/email-chk
- Owner: brandon93s
- License: mit
- Created: 2017-09-17T18:23:03.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-09-23T16:07:02.000Z (over 8 years ago)
- Last Synced: 2025-07-08T15:51:30.952Z (11 months ago)
- Topics: email, email-validation, email-validator, email-verification
- Language: JavaScript
- Homepage:
- Size: 143 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# email-chk [](https://travis-ci.org/brandon93s/email-chk)
> Checks if an email is valid & real by contacting the associated remote mail server :email:
*See [email-chk-cli](https://github.com/brandon93s/email-chk-cli) for the command-line tool.*
## Install
```
$ npm install --save email-chk
```
## Usage
```js
const emailChk = require('email-chk')
try {
const exists = await emailChk('test@example.com')
}
catch (e) {
// connection refused or server error occurred
}
// or
emailChk('test@example.com')
.then(console.log)
.catch(console.error)
```
## API
### emailChk(email [,options])
Returns a `boolean` representing if the email is valid & real
#### email
Type: `string`
The email to verify and check existence for
#### options
##### timeout
Type: `number`
Default: `5000`
The [idle timeout](https://nodejs.org/api/net.html#net_socket_settimeout_timeout_callback) in ms for the socket performing requests
##### host
Type: `string`
Default: domain of `email`
The domain of the originating SMTP server for the request
##### from
Type: `string`
Default: `email`
The originating email for the request
## Related
- [email-chk-cli](https://github.com/brandon93s/email-chk-cli) - CLI for this module
- [email-chk-lambda](https://github.com/brandon93s/email-chk-lambda) - Lambda function for this module
## License
MIT © [Brandon Smith](https://github.com/brandon93s)