• Stars
    star
    829
  • Rank 55,018 (Top 2 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created over 4 years ago
  • Updated 11 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Validates regex, typos, disposable, dns and smtp

Email Validator

Validates email addresses based on regex, common typos, disposable email blacklists, DNS records and SMTP server response.

  • 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.
  • Validates email was not generated by disposable email service using disposable-email-domains.
  • Validates MX records are present on DNS.
  • Validates SMTP server is running.
  • Validates mailbox exists on SMTP server.
  • Native typescript support.

Getting Started

Compatible with nodejs only. Not browser ready.

Install like so

npm i deep-email-validator --save

or with yarn

yarn add deep-email-validator

Use like so

import { validate } from 'deep-email-validator'
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": "Mailbox not found.",
  //       }
  //   }
  // }

  // Can also be called with these default options
  await validate({
    email: '[email protected]',
    sender: '[email protected]',
    validateRegex: true,
    validateMx: true,
    validateTypo: true,
    validateDisposable: true,
    validateSMTP: true,
  })
}

If you want to validate domains with TLDs that are not supported by default, you can use additionalTopLevelDomains option:

await validate({
  email: '[email protected]',
  sender: '[email protected]',
  validateRegex: true,
  validateMx: true,
  validateTypo: true,
  validateDisposable: true,
  validateSMTP: true,
  additionalTopLevelDomains: [ 'ir' ]
})

For a list of TLDs that are supported by default you can see here.

Default options can be found here

More Repositories

1

brightpath-backend

Find the safest well lit walking path between two locations on earth.
Go
122
star
2

git-sub-dir

Downloads sub-directory of a github repository.
Python
59
star
3

seam-carving-js

Javascript implementation of Seam Carver. Seam Carver is a content-aware image resizing algorithm
JavaScript
33
star
4

Youtube-Playlist-Manager

An advanced playlist manager for youtube, that lets you perform various batch actions.
JavaScript
22
star
5

angular-slideout

Mobile friendly, animated, reusable angular.js slideout directive.
JavaScript
9
star
6

countdown-solver

TypeScript
7
star
7

treasure

A game to introduce the concept of binary search in an intuitive way
JavaScript
7
star
8

observable-state-tree

An observable state tree is a normal object except that listeners can be bound to any subtree of the state tree.
TypeScript
7
star
9

async-await-with-generators

Async await implemented with generators
JavaScript
6
star
10

coderacer

Competitive touch typing for JavaScript programmers
TypeScript
5
star
11

stripe-sca-subscription-react

React Stripe Elements Subscription with SCA Starter
JavaScript
4
star
12

moving-eyes-photos

Personal website
HTML
3
star
13

mfbx9da4.github.io

A calling card and a place to aggregate my projects
SCSS
2
star
14

amp-jekyll

This is a port of the AMP start bike shop template to jekyll.
HTML
2
star
15

react-native-jsi-promise

Java
2
star
16

deep-email-validator-express

Deep Email Validation Endpoint
TypeScript
2
star
17

coding-dojo-29-jan-2020

TypeScript
1
star
18

react-native-zendesk-test

Java
1
star
19

editor_atomate

1
star
20

python-vscode-starter

Python
1
star
21

neuron-astrocyte-networks

Modified feedforward neural network models to represent neuron-astrocyte interactions.
Python
1
star
22

blog

An experiment using mongodb, node, emberjs and ace editor
JavaScript
1
star
23

ng-server-time

Time synchronization directive between angular and node server using socket.io. Emulating NTP protocol.
JavaScript
1
star
24

hntv

YC's Hacker News - just videos
JavaScript
1
star
25

rhythm_game

aims to teach users rhythm. google app engine and python backend. game is HTML5
JavaScript
1
star
26

django-timer

A profiling timer util for django projects.
Python
1
star
27

brightpath-frontend

Find the safest well lit walking path between two locations.
JavaScript
1
star
28

instructorlist-frontend

JavaScript
1
star
29

nextjs-preactx

JavaScript
1
star
30

proof-of-concept-jsi

Java
1
star
31

tdd-typescript-starter

TypeScript
1
star
32

tree-drawing-algorithms

TypeScript
1
star