email-check-strong
v1.0.1
Published
check email or mx record
Downloads
1
Readme
Email Check Strong
const emailCheckSrtong = require('email-check-strong');
const ecs = new EmailCheckStrong(
'[email protected]', // Email from (Required)
{
'oneMX' : false, // checked one mx record (default: false)
'telnetTimeout' : 2000, // Timeout connection telnet (default: 2000)
'MxCache' : 18000000 // Time Cache mx records (default: 18000000)
}
);
// Check validation email
ecs.checkEmail('[email protected]'); // False|String
//false
// Parse email
ecs.parseEmail('[email protected]'); // False|Object
// {
// 'name' : 'test,
// 'domain' : 'gmail.com',
// 'email' : '[email protected]',
// 'original' : '[email protected]'
// }
// Check valid and MX and Connection
try {
const test = await ecs.test('[email protected]'); // Promis<object>
if(test.success){
// The mail server responds and such an account is created
console.log('Success');
}else{
// Mail server responding but account verification failed
console.log('Success');
}
}catch (e){
// Error
console.error('Error', e.data);
}