email-verifier-2
v1.0.0
Published
Checks if the email is valid or not
Readme
🔍 email-verifier
A lightweight Node.js package to validate email addresses using format checks, MX DNS records, and optional SMTP inbox verification — all without external dependencies.
🚀 Features
- ✅ Email syntax validation
- 🔁 MX record lookup (checks domain can receive emails)
- 🛡️ Disposable email detection
- 📬 Optional SMTP inbox existence check (⚠️ not 100% reliable)
📦 Installation
npm install -S email-verifier🧠 Usage
const { verifyEmail } = require('email-verifier');
(async () => {
const result = await verifyEmail('[email protected]', {
checkInbox: true, // Optional: check if inbox actually exists
checkMX: true //Optional: check DNS MX records
});
console.log(result);
})();📘 API
verifyEmail(email, options)
Performs full email verification.
Parameters:
Name | Type | Default | Description
email | string | — | The email address to verify
options.checkInbox | boolean | false | Whether to check if the inbox exists via SMTP
options.checkMX | boolean | false | Whether to check if the inbox exists via SMTP
