1

How can i verify an email without sending emails.

if an user sign-up with an email like 'asdasdasdada@email.com', i need to verify if that email exists, and i can send emails.

i already tried with deep-email-validator but it doesn't work correctly, it says that a existent email is not valid

async function isEmailValid(email: string) {
  return emailValidator(email);
}

const result = isEmailValid('<my real email>');
console.log(result)

output:

{
  valid: false,
  validators: {
    regex: { valid: true },
    typo: { valid: true },
    disposable: { valid: true },
    mx: { valid: false, reason: 'MX record not found' },
    smtp: { valid: false }
  },
  reason: 'mx'
}
  • asdasdasdada@email.com is not a valid email so the API works excellent try sending it Gmail and there is a response hey that email is not valid –  Aug 20 '21 at 02:48
  • yeah, but i verify my real email and it throws an error that says that it didn't find the smtp server and mx – CesarMarcanoQuijada Aug 20 '21 at 04:08
  • you can use regex to validate email, example here: https://stackoverflow.com/a/46181/8721545, "MX record not found" maybe MX record still is not configured yet or it's configured wrong – Hoang Duong Aug 20 '21 at 05:22

1 Answers1

-1

deep-email-validator may give back inaccurate results which depend on the reputation of your IP address(es) and may even hurt it - beware.

Verifalia is a cloud-based hosted email verification SaaS which allows to verify whether an email address exists or not without sending any verification emails and without any risk for your IP address(es): it comes with a free and open source npm package (for Node.js and the browser) you can easily plug into your Node.js app which supports the CommonJS module system as well as ES modules (available in Node.js v13 and higher).

Here is how you can verify an email address using Verifalia in Node.js, after installing it (npm install verifalia):

const { VerifaliaRestClient } = require('verifalia');

// ...

const verifalia = new VerifaliaRestClient({
    username: 'username',
    password: 'password'
});

const validation = await verifalia
    .emailValidations
    .submit('batman@gmail.com', true);

// At this point the address has been validated: let's print
// its email validation result to the console.

const entry = validation.entries[0];
console.log(entry.inputData, entry.classification, entry.status);

// Prints out something like:
// batman@gmail.com Deliverable Success

To learn more about how Verifalia works please see: https://verifalia.com/how-it-works


Disclaimer: I am the CTO of Verifalia. ;)

Efran Cobisi
  • 5,122
  • 18
  • 22