Professional Email Validation Library

Email Validator JS

Advanced Node.js email validation library with RFC 5321 compliance, batch processing, detailed error reporting, automatic retry mechanisms, and TypeScript support for enterprise applications.

GitHubNPM

Key Features

RFC 5321 Compliant

Full compliance with RFC 5321 email validation standards for maximum accuracy

MX Record Verification

Real-time domain MX record validation to ensure email deliverability

SMTP Connection Check

Deep SMTP verification with automatic retry for transient failures

Batch Processing

Concurrent batch email verification for high-volume validation needs

Smart Detection

Identify disposable, free, and role-based email addresses instantly

Detailed Error Reporting

Comprehensive error codes and messages for debugging and user feedback

Installation

NPM
npm install @devmehq/email-validator-js
Yarn
yarn add @devmehq/email-validator-js

Code Examples

Basic Usage

import { verifyEmail } from '@devmehq/email-validator-js';

const result = await verifyEmail({ 
  emailAddress: 'user@example.com',
  verifyMx: true,
  verifySmtp: true,
  timeout: 3000
});

console.log(result);
// { 
//   validFormat: true,
//   validMx: true, 
//   validSmtp: true
// }

Batch Email Verification

import { verifyEmailBatch, verifyEmailDetailed } from '@devmehq/email-validator-js';

// Batch verification for multiple emails
const emails = [
  'valid@example.com',
  'invalid@fake-domain.xyz',
  'disposable@tempmail.com',
  'user@gmail.com'
];

// Parallel batch processing
const results = await verifyEmailBatch({
  emails: emails,
  verifyMx: true,
  verifySmtp: true,
  concurrency: 5 // Process 5 emails simultaneously
});

console.log(results);
// Returns array of validation results for each email

// Detailed verification with error codes
const detailed = await verifyEmailDetailed({
  emailAddress: 'user@example.com',
  verifyMx: true,
  verifySmtp: true,
  timeout: 5000
});

console.log(detailed.errorCode); // Specific error code for debugging
console.log(detailed.errorMessage); // Human-readable error message

Advanced Configuration

import { verifyEmail, isDisposableEmail, isFreeEmail } from '@devmehq/email-validator-js';

// Configure validation with retry and caching
const validateWithRetry = async (email: string) => {
  const config = {
    emailAddress: email,
    verifyMx: true,
    verifySmtp: true,
    timeout: 5000,
    retryAttempts: 3, // Retry failed checks
    cacheResults: true // Cache for performance
  };

  try {
    // Full validation with all checks
    const result = await verifyEmail(config);
    
    // Additional checks
    const [isDisposable, isFree] = await Promise.all([
      isDisposableEmail(email),
      isFreeEmail(email)
    ]);

    return {
      valid: result.validFormat && result.validMx && !isDisposable,
      details: {
        format: result.validFormat,
        mx: result.validMx,
        smtp: result.validSmtp,
        disposable: isDisposable,
        free: isFree
      }
    };
  } catch (error) {
    // Handle errors with specific codes
    if (error.code === 'SMTP_CONNECT_FAILED') {
      console.log('SMTP server unreachable');
    }
    throw error;
  }
};

React Form Integration

// Complete form validation with UI feedback
const EmailValidationForm = () => {
  const [email, setEmail] = useState('');
  const [validation, setValidation] = useState(null);
  const [loading, setLoading] = useState(false);

  const validateEmail = async () => {
    setLoading(true);
    try {
      const detailed = await verifyEmailDetailed({
        emailAddress: email,
        verifyMx: true,
        verifySmtp: true
      });
      
      setValidation({
        valid: detailed.validFormat && detailed.validMx,
        format: detailed.validFormat,
        mx: detailed.validMx,
        smtp: detailed.validSmtp,
        errorCode: detailed.errorCode,
        errorMessage: detailed.errorMessage
      });
    } catch (error) {
      setValidation({ 
        valid: false, 
        errorMessage: error.message 
      });
    }
    setLoading(false);
  };

  return (
    <div className="email-validator">
      <input 
        type="email" 
        value={email}
        onChange={(e) => setEmail(e.target.value)}
        placeholder="Enter email to validate"
      />
      <button onClick={validateEmail} disabled={loading}>
        {loading ? 'Validating...' : 'Validate Email'}
      </button>
      
      {validation && (
        <div className="results">
          {validation.valid ? (
            <div className="success">
              ✅ Valid Email
              <p>Format: {validation.format ? '✓' : '✗'}</p>
              <p>MX: {validation.mx ? '✓' : '✗'}</p>
              <p>SMTP: {validation.smtp ? '✓' : '✗'}</p>
            </div>
          ) : (
            <div className="error">
              ❌ Invalid Email
              {validation.errorMessage && (
                <p>Error: {validation.errorMessage}</p>
              )}
              {validation.errorCode && (
                <p>Code: {validation.errorCode}</p>
              )}
            </div>
          )}
        </div>
      )}
    </div>
  );
};

Use Cases

Improve email campaign delivery rates by up to 95%

Protect signup forms from spam and fake registrations

Reduce bounce rates in marketing automation platforms

Enhance marketing IP reputation with clean email lists

Validate bulk email lists with concurrent batch processing

Prevent disposable emails in subscription services

Ensure data quality in CRM and customer databases

Optimize transactional email deliverability

Comply with email marketing best practices

Save costs by removing invalid emails before sending

Performance & Reliability

95%+

Delivery rate improvement

RFC 5321

Full compliance

Parallel

Batch processing

API Reference

verifyEmail(options)

Main validation function that performs comprehensive email verification.

Options:

  • emailAddress: string - Email to validate
  • verifyMx: boolean - Check MX records (default: true)
  • verifySmtp: boolean - Check SMTP connection (default: false)
  • timeout: number - Connection timeout in ms (default: 10000)

verifyEmailDetailed(options)

Advanced verification with detailed error codes and messages for debugging.

verifyEmailBatch(options)

Concurrent batch email verification with configurable parallelism.

isDisposableEmail(email)

Check if email address is from a disposable/temporary email provider.

isFreeEmail(email)

Check if email address is from a free email provider (Gmail, Yahoo, etc.).

Technical Details

Advanced Features

  • RFC 5321 compliant email validation
  • Automatic retry for transient failures
  • Configurable verification depth
  • Built-in caching mechanism
  • Detailed error reporting with codes

Developer Experience

  • Full TypeScript support (>= 4.0)
  • Node.js >= 12.0 compatibility
  • Comprehensive documentation
  • Production-ready with enterprise support
  • Regular updates and maintenance

Simple, Transparent Pricing

Choose the perfect plan for your validation needs. All plans include full API access, TypeScript support, and regular updates.

Startup

Perfect for small businesses and MVPs

$49/month
  • Up to 100,000 validations/month
  • All validation features
  • Email support
  • Commercial use license
Get Started
MOST POPULAR

Business

For growing companies with higher volume

$149/month
  • Up to 500,000 validations/month
  • All validation features
  • Priority email support
  • Commercial use license
  • Bulk validation optimization
Get Started

Enterprise

For large-scale applications

$399/month
  • Unlimited validations
  • All validation features
  • 24/7 priority support
  • Commercial use license
  • Custom integration support
  • SLA guarantee
Contact Sales

One-Time License

Perpetual license for a single product - no recurring fees

$2,999

one-time payment

Purchase License

Licensing Terms

Community Edition (Free)

This library is distributed under the Business Source License (BSL) 1.1. You can use it freely for:

  • Non-production environments
  • Development and testing
  • Open source projects
  • Educational purposes

Commercial License Required For:

  • Production use in commercial applications
  • SaaS products and services
  • Revenue-generating projects
  • Enterprise deployments

Questions about licensing? Contact us at sales@dev.me

Email Validator JS - Advanced Email Validation Library | Dev.me | dev.me