1.0.0 • Published 9 years ago

mail-tester v1.0.0

Weekly downloads
6
License
MIT
Repository
github
Last release
9 years ago

Mail-tester - An easier way to test emails

Build Status Code Climate Test Coverage

Mail-tester is an npm module, that uses the MailTest-API to easily check whether an email being used in your node application is

  • a valid email ID
  • a disposable email ID
  • a robot domain
  • an invalid email ID

Installation

$ npm install mail-tester 

API

First require the package in your application

$ var mailTester = require('mail-tester');

The mailTester object exposes the following functions:

mailTester.check(email, callback)

This function takes an email and a callback as parameters. It checks the email against the Mailtest-API and passes the result through a parameter in the callback function.

Example:

var mailTester = require('mail-tester');
  
var email = 'test@gmail.com';
  
mailTester.check(email, function(data) {
  console.log(data);
})

The output of the above snippet would be

{ 
  code: '01', 
  status: 'ACTIVE', 
  message: 'OK' 
}

Response Types

The following types of responses may be returned for a given test email.

CodeStatusMessage
01ACTIVEOK
11DISPOSABLEDisposable Email
12ROBOTMonetized Bounce
21INVALIDInvalid Domain
22INVALIDUnregistered Domain
23INVALIDNo MX Records Found
81UNKNOWNWhoIs Lookup Error
82UNKNOWNDNS Lookup Error
91ERRORRate Limit Exceeded
92ERRORInternal Server Error

Note: MailTest limits their service to 120 requests per hour per IP.

Licence

MIT

1.0.0

9 years ago