Coder Social home page Coder Social logo

email-provider's Introduction

Email provider service detector

Detect Provider's Service name by email address

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
  3. Find Service product name by its hostname (googlemail.com -> Gmail)

Usage

Install

npm i --save email-provider

or

yarn add email-provider

Connect 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);
     })

License

MIT

email-provider's People

Contributors

nespecc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

email-provider's Issues

Provide option to not fetch name

This would be much more useful to me if you made it optional to extract the name from the url. Unfortunately the name will not be stable and often times is something wack like Sign in to your Microsoft account. Really for my use case I need a stable enum of which provider this is e.g. outlook, yahoo, gmail

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.