1.0.1 • Published 1 year ago
email-check-strong v1.0.1
Email Check Strong
const emailCheckSrtong = require('email-check-strong');
const ecs = new EmailCheckStrong(
'test@gmail.com', // 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('test@gmail.com'); // False|String
//false
// Parse email
ecs.parseEmail('test@Gmail.Com'); // False|Object
// {
// 'name' : 'test,
// 'domain' : 'gmail.com',
// 'email' : 'test@gmail.com',
// 'original' : 'test@Gmail.Com'
// }
// Check valid and MX and Connection
try {
const test = await ecs.test('test@Gmail.Com'); // 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);
}