A Node.js-based API for verifying email addresses, including format validation, MX record checks, SMTP verification, and disposable email detection.
- Email Format Validation: Checks if the email address is syntactically valid.
- MX Record Lookup: Ensures the domain has valid mail exchange (MX) records.
- SMTP Verification: Attempts to connect to the mail server to verify if the email address is accepted.
- Disposable Email Detection: Blocks emails from known disposable email providers using a comprehensive blocklist.
- Clone the repository:
git clone <repo-url> cd email-verifier
- Install dependencies:
npm install
npm run devThe server will run on http://localhost:3001.
Verifies an email address for format, domain, MX records, and SMTP acceptance.
- Request Body:
{ "email": "user@example.com" } - Response:
200 OKwith verification result, or400with error reason.
Performs SMTP-level verification and disposable email detection.
- Request Body:
{ "email": "user@example.com" } - Response:
200 OKwith detailed SMTP verification result, or400/500with error reason.
{
"valid": true,
"reason": "SMTP: Email accepted by server",
"mx_domain": "mx.example.com",
"mx_record": { "priority": 10, "exchange": "mx.example.com" },
"catch_all": false,
"disposable": false
}- Disposable email domains are blocked using the
disposable_email_blocklist.jsonfile.
ISC