mail43 v1.0.5
/* * * mail43 * */ const mail43 = require('mail43');
// declaring an email account const EMAIL_ACCOUNT = new mail43.account(app, 'YOURDOMAIN.COM', { host: 'smtp.example.com', port: 465, use_tls: true, username: 'no-reply@example.com', password: 'Your email password' });
// verifying an user const verification = EMAIL_ACCOUNT.verify('example@gmail.com', { subject: 'Email verification test', body: 'Hello world!<br>Press this button: {button}<br>Or if it doesn't work, use this link {link}' }, 'YOUR_REDIRECT_URL', feed)
// handling feeds function feed(callback_type, data){ if(callback_type === 'error') throw new Error(data); else if(callback_type === 'sended') console.log("Sended email verification (UUID: %s", data); else if(callback_type === 'verified' && data === verification) console.log("User verified the Email Account, UUID: %s", data); }
// Starting server app.listen(3000);