https://github.com/codex-team/email-provider
Detect email provider by address
https://github.com/codex-team/email-provider
email email-providers mx subscribe-email
Last synced: about 1 year ago
JSON representation
Detect email provider by address
- Host: GitHub
- URL: https://github.com/codex-team/email-provider
- Owner: codex-team
- License: mit
- Created: 2018-09-04T15:33:22.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-09-06T13:25:41.000Z (almost 8 years ago)
- Last Synced: 2025-04-14T23:11:41.285Z (about 1 year ago)
- Topics: email, email-providers, mx, subscribe-email
- Language: JavaScript
- Size: 421 KB
- Stars: 46
- Watchers: 2
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Email provider service detector

Detect Provider's Service name by email address
```js
team@youtube.com -> { name: 'Gmail', url: 'https://googlemail.com' }
test@kinopoisk.ru -> { name: 'Яндекс', url: 'https://yandex.ru' }
```
## Why
It can be useful for improving User Experience after entering an email address:
1) User enters an email address
2) You have sent confirmation email to him
3) On the same place, you can show `Open Gmail|Yahoo|Яндекс|etc` button

## How it words
1. Fetching DNS MX records for email address
2. Find MX host at the free email services datastore, collected by [freemail](https://github.com/willwhite/freemail/blob/master/data/free.txt)
3. Find Service product name by its hostname (`googlemail.com` -> `Gmail`)
## Usage
### Install
```js
npm i --save email-provider
```
or
```js
yarn add email-provider
```
### Connect and call
```js
const emailProvider = require('email-provider');
let email = 'test@google.com';
emailProvider.get(email)
.then( service => {
console.log(service.name); // Gmail
console.log(service.url); // https://googlemail.com
})
.catch( error => {
console.log('Email provider was not reached:', error);
})
```
## License
MIT