This node module was inspired by email-verify, but I modified and added some functionalities according to my needs. It was used in production for more than a year without any problems. Those changes are such as:
-
Generate possible emails from first_name, last_name, and domain_name.
-
Support catchAll.
-
Support a list of emails to do verification.
-
Support verbose mode.
You need to have a static IP which acts as like an SMTP server to do communication with other SMTP servers. It should have valid MX Records and PTR Records. Otherwise, your IP will be recorded as a spammer. Use mxtoolbox.com to monitor your IP.
Run the following command to see available options:
$ smtp_checker -h
Example:
$ smtp_checker -e [email protected] -v
220 mx.google.com ESMTP c24si3754682pfl.259 - gsmtp
EHLO mail.example.org
250-mx.google.com at your service, [203.223.47.204]
250-SIZE 157286400
250-8BITMIME
250-STARTTLS
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-CHUNKING
250 SMTPUTF8
MAIL FROM:<[email protected]>
250 2.1.0 OK c24si3754682pfl.259 - gsmtp
RCPT TO:<[email protected]>
550-5.1.1 The email account that you tried to reach does not exist. Please try
550-5.1.1 double-checking the recipient's email address for typos or
550-5.1.1 unnecessary spaces. Learn more at
550 5.1.1 https://support.google.com/mail/?p=NoSuchUser c24si3754682pfl.259 - gsmtp
RCPT TO:<[email protected]>
250 2.1.5 OK c24si3754682pfl.259 - gsmtp
QUIT
221 2.0.0 closing connection c24si3754682pfl.259 - gsmtp
{
found: true,
emails: [ '[email protected]' ],
response: '220 mx.google.com ESMTP i61si4119769plb.383 - gsmtpEHLO mail.example.org\r\n250-mx.google.com at your service, [203.223.47.204]\r\n250-SIZE 157286400\r\n250-8BITMIME\r\n250-STARTTLS\r\n250-ENHANCEDSTATUSCODES\r\n250-PIPELINING\r\n250-CHUNKING\r\n250 SMTPUTF8MAIL FROM:<[email protected]>\r\n250 2.1.0 OK i61si4119769plb.383 - gsmtp\r\nRCPT TO:<[email protected]>\r\n550-5.1.1 The email account that you tried to reach does not exist. Please try\r\n550-5.1.1 double-checking the recipient\'s email address for typos or\r\n550-5.1.1 unnecessary spaces. Learn more at\r\n550 5.1.1 https://support.google.com/mail/?p=NoSuchUser i61si4119769plb.383 - gsmtp\r\nRCPT TO:<[email protected]>\r\n250 2.1.5 OK i61si4119769plb.383 - gsmtpQUIT\r\n221 2.0.0 closing connection i61si4119769plb.383 - gsmtp',
catchAll: false
}