Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mailgun-validate

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mailgun-validate

Email validation for node.js using Mailgun's API

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

mailgun-validate

Simple email validation for node.js using Mailgun's API. Performs

  • Syntax checks (RFC defined grammar)
  • DNS validation
  • Spell checks
  • Email Service Provider (ESP) specific local-part grammar (if available).

You will need to sign up at mailgun.net for a public API key.

A PHP version is also available here: github.com/kehers/MG_Email.

Installation

npm install mailgun-validate

Use

var Validator = require('mailgun-validate');

var validator = new Validator('mail-gun-pub-key');
validator.validate('someemail@test.com', function(err, response) {
	if (err) {
		// Validation error
		// Log and fallback to regular expressions
		return;
	}

	/* response = {
	        "is_valid": true,
	        "address": "foo@mailgun.net",
	        "parts": {
	            "display_name": null,
	            "local_part": "foo",
	            "domain": "mailgun.net",
	        },
	        "did_you_mean": null
		}//*/

	if (response.is_valid) {
		// Email valid
	}
	else {
		// Email invalid
		if (response.did_you_mean) {
			// Did your mean response.did_you_mean?
		}
	}
})

Licence

MIT

Keywords

FAQs

Package last updated on 27 Dec 2014

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc