EmailVerify / email-verify

Node.js email SMTP verification, powered by EmailChecker.com API
https://emailchecker.com/real-time-api
280 stars 103 forks source link

Connection error while verifying mail adress #59

Open manuellagrand opened 4 years ago

manuellagrand commented 4 years ago

Hi, thanks for the package. I have an issue when I want to check an email adress with the package. I use the stand alone email-verify anemail@domain.com version and the followng sample code:

const verifier = require('email-verify');

const infoCodes = verifier.infoCodes;

verifier.verify("anemail@domain.com", (err, info) => {
    if(err) {
      console.log(err);
    }
    else{
      console.log( "Success (T/F): " + info.success);
      console.log( "Info: " + info.info );

      //Info object returns a code which representing a state of validation:

      //Connected to SMTP server and finished email verification
      console.log(info.code === infoCodes.finishedVerification);

      //Domain not found
      console.log(info.code === infoCodes.domainNotFound);

      //Email is not valid
      console.log(info.code === infoCodes.invalidEmailStructure);

      //No MX record in domain name
      console.log(info.code === infoCodes.noMxRecords);

      //SMTP connection timeout
      console.log(info.code === infoCodes.SMTPConnectionTimeout);

      //SMTP connection error
      console.log(info.code === infoCodes.SMTPConnectionError)
    }
  })

I tested this sample code on my laptop and the website repI.it (https://repl.it/languages/nodejs) but I always have this error:

OperationalError: connect ETIMEDOUT 104.47.1.36:25 error at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16) { errno: 'ETIMEDOUT', code: 'ETIMEDOUT', syscall: 'connect', address: '104.47.2.36', port: 25 }

why I keep getting this error and there is a way to resolve it?

I use nodeJS 12.18.2 and email-verify 0.2.1 on Ubuntu 18.04 and my network connection is Fiber To The Last Amplifier.

duke7able commented 3 years ago

having the same issue