📅 You're Invited: Meet the Socket team at RSAC (April 28 – May 1).RSVP
Socket
Sign inDemoInstall
Socket

email-domain-validator

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

email-domain-validator

To validate email host & mail exchange using DNS protocol

2.0.1
latest
Source
npm
Version published
Weekly downloads
404
7.16%
Maintainers
1
Weekly downloads
 
Created
Source

email-domain-validator

NMP module to validate email host & mail exchange using DNS protocol.

npm version Build Status

Features

  • Email host mail exchange (MX) validation using DNS protocol.
  • Email address string validation using JOI

(Supports Typescript without any additional type definitions)

//Code snippet for Javascript 
const EmailDomainValidator = require("email-domain-validator");

// To validate multiple email id give input as comma seperated string "test@test.com, xyz@abc.com"
EmailDomainValidator.validate("test@test.com")
	.then(function(data){
		console.log("Success ", data);
	})
	.catch(function(err){
		console.log("ERR: ", err);
	});
//Code snippet for Typescript
import { validate } from"email-domain-validator";
validate("test@test.com")
	.then(function(data){
		console.log("Success ",data);
	})
	.catch(function(err){
		console.log("ERR: ", err);
	});

//Valid Domain Response Object
	{
		isValidDomain: true,
		erorrMessage: [],
		invalidEmailList: []
	}
//Valid Domain Response Object
	{ 
		isValidDomain: false,
		erorrMessage: [ 'test@test.com - queryMx ENODATA test.com'],
		invalidEmailList: [ 'test@test.com'] 
	};

Keywords

email

FAQs

Package last updated on 11 Feb 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts