email-provider
v1.0.1
Published
Detect email provider by email address
Downloads
20
Readme
Email provider service detector
Detect Provider's Service name by email address
[email protected] -> { name: 'Gmail', url: 'https://googlemail.com' }
[email protected] -> { name: 'Яндекс', url: 'https://yandex.ru' }
How it words
- Fetching DNS MX records for email address
- Find MX host at the free email services datastore, collected by freemail
- Find Service product name by its hostname (
googlemail.com->Gmail)
Usage
Install
npm i --save email-provideror
yarn add email-providerConnect and call
const emailProvider = require('email-provider');
let email = '[email protected]';
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);
})