1.0.3 • Published 9 years ago

temporary-email-address-validator v1.0.3

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

Temporary Email Address Validator Node.js

As a owner or web master you wouldn’t really want someone anonymously utilizing your website or campaign benefits. So You really want to prevent using temporary email addresses on website. So this Node Module was created in an attempt to make a collection of disposable email addresses and validate signups against with the list of temporary email providers.

Install the node package : npm i temporary-email-address-validator

Example

var express = require('express');
var bodyParser = require('body-parser');
var disposableEmail = require('temporary-email-address-validator');

var app = express();
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));

app.get('/', function(req, res){

  var html = '<form action="/" method="post">' +
               'Enter your name:' +
               '<input type="email" name="EmailAddress" placeholder="..." />' +
               '<br>' +
               '<button type="submit">Check</button>' +
            '</form>';
               
  res.send(html);
});

app.post('/', function(req, res){
  var EmailAddress = req.body.EmailAddress;
  var result = disposableEmail.validate(EmailAddress), result_text ="OK";
  if (!result){
    result_text = "Alert!!";
  }
  var html = 'Email: ' + EmailAddress + ': '+result_text+'<br>' +
             '<a href="/">Try again.</a>';
  res.send(html);
});

app.listen(3000);

Run with node app.js

#Documentation Temporary Email Address Validator

Looking for PHP / Java script / Python version of this plugin?

Temporary Email Address Validator

1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago