RepositoryPHP
aman00323

aman00323/email-checker

Provides email verification on the go.

162stars
35forks
1issues
2views

Featured achievements

The project's latest awards

1
TINIX TRENDING·Topic: email-checker

#1 Repository of the month

1
TINIX TRENDING·Topic: verify

#1 Repository of the month

1
TINIX TRENDING·Topic: verification

#1 Repository of the month

Email Checker

GitHub license GitHub release Packagist Downloads PHP Version codecov

Email Checker helps you reduce fake signups and disposable email usage by validating addresses with a practical multi-step flow.

Why Use It

  • disposable-domain detection
  • MX/DNS checks
  • SMTP probe (when possible)

Use it in registration and lead-capture flows where cleaner email data matters.

Quick Start

Install:

composer require aman00323/emailchecker

Basic check:

use Aman\EmailVerifier\EmailChecker;

$result = app(EmailChecker::class)->checkEmail('user@example.com', true);

if ($result['success']) {
	// Use $result['disposable'], $result['mxrecord'], $result['domain']
} else {
	// Use $result['error']
}

Compatibility

Package VersionPHPLaravel
3.x>= 8.110.x, 11.x, 12.x

Installation

Email Checker requires PHP >= 8.1 and supports modern Laravel versions.

To get the latest version, require the project using Composer:

composer require aman00323/emailchecker

Once installed, include Aman\EmailVerifier\EmailChecker to access validation methods.

Optional: publish package config to tune SMTP behavior globally:

php artisan vendor:publish --tag=emailchecker-config

This creates config/emailchecker.php with defaults for probe toggle, port, timeout, and sender email.

Configuration

Published config (config/emailchecker.php) example:

<?php

return [
    'smtp_probe' => env('EMAIL_CHECKER_SMTP_PROBE', true),
    'smtp_port' => (int) env('EMAIL_CHECKER_SMTP_PORT', 25),
    'smtp_timeout_seconds' => (int) env('EMAIL_CHECKER_SMTP_TIMEOUT_SECONDS', 5),
    'from_email' => env('EMAIL_CHECKER_SET_FROM', 'example@example.com'),
];

Use global config when:

  • you want one default behavior across the whole Laravel app
  • settings should come from environment variables per deployment

Use per-instance setters when:

  • you need request-specific behavior
  • you want to override defaults for one check flow only
$checker = app(EmailChecker::class);

$checker
    ->setSmtpProbeEnabled(false)
    ->setSmtpPort(2525)
    ->setSmtpTimeoutSeconds(10)
    ->setFromEmail('ops@example.com');

Usage

Check Disposable Emails

If you want to check whether an email is disposable, use the method below.

Pass true as the second argument to enable deep checking against the full disposable-domain dataset shipped in this package.

app(EmailChecker::class)->checkDisposableEmail('something@example.com', true);

This checks the address domain against the disposable-domain dataset included in this package.

Check DNS and MX Records

For better SMTP responses, set a sender email first:

app(EmailChecker::class)->setFromEmail('something@example.com');

Or set an environment variable:

EMAIL_CHECKER_SET_FROM='something@example.com'

You can also configure probe behavior globally via environment variables:

EMAIL_CHECKER_SMTP_PROBE=true
EMAIL_CHECKER_SMTP_PORT=25
EMAIL_CHECKER_SMTP_TIMEOUT_SECONDS=5

This method checks DNS and MX records, then attempts an SMTP handshake using fsockopen().

app(EmailChecker::class)->checkMxAndDnsRecord('something@example.com');

This returns an array like ['valid'|'invalid', 'details...'].

For better output, your server should support fsockopen().

Check Domain Status

This method validates domain existence through DNS record checks (MX, A, AAAA, CNAME).

app(EmailChecker::class)->checkDomain('something@example.com');

This method returns true when at least one supported DNS record exists; otherwise false.

Check Email

This method runs disposable, MX/DNS+SMTP, and domain checks and returns a structured response.

app(EmailChecker::class)->checkEmail('something@example.com', true);

All methods can be used independently, or together via checkEmail().

Example success response:

[
    'success' => true,
    'disposable' => ['success' => true, 'detail' => 'Email address is not disposable'],
    // Legacy key, kept for backward compatibility:
    'dispossable' => ['success' => true, 'detail' => 'Email address is not disposable'],
    'mxrecord' => ['success' => true, 'detail' => 'Valid email address'],
    'domain' => ['success' => true, 'detail' => 'Domain exists.'],
]

Limits and Expectations

No email verification library can guarantee 100% certainty for every mailbox.

  • Some mail servers block SMTP probes
  • Some domains are valid but intentionally restrictive
  • Disposable-domain providers change frequently

Use this package as a high-signal filter, not a single source of truth.

Deprecations and Migration Notes

The package keeps old keys/properties for compatibility, but new integrations should use corrected names.

LegacyUse InsteadStatus
dispossable (response key)disposableDeprecated, still returned
$checker->domian$checker->domainDeprecated, still synchronized

Migration recommendation:

  • read disposable in new code
  • keep fallback support for dispossable in existing clients until your next major release

Contribution

All contributors are welcome. Please keep code style consistent and ensure tests pass before opening a pull request.

Keeping Disposable Domains Updated

Refresh the domain dataset locally:

composer update-disposable-domains

This command fetches trusted source lists, normalizes and deduplicates domains, rewrites shard files in resources/domains, and updates resources/domains/metadata.json.

The repository also includes a daily scheduled GitHub Actions workflow to automate refreshes and open pull requests when updates are available.

Sponsorship and Commercial Support

If this package saves your team time or prevents signup abuse in production, please consider supporting maintenance.

  • Sponsor ongoing open-source maintenance
  • Fund roadmap items and faster issue triage
  • Request paid integration support for your project

For sponsorship or paid support, contact: aman.gopher@gmail.com

Credits

Thanks to all contributors and users who helped this package reach broad production usage.

Similar Projects

Discover other similar projects and AI models.

RepositoryRust
reacherhq/check-if-email-exists

Check if an email address exists without sending any email, written in Rust. Comes with a ⚙️ HTTP backend.

10.6k
Nov 26, 2026
RepositoryPHP
firefly-iii/firefly-iii

Firefly III: a personal finances manager

25.4k
Nov 30, 2026
RepositoryPHP
krayin/laravel-crm

Krayin CRM is Free & Open Source CRM Built with Laravel for Customer, Lead, and Sales Management.

24.2k
Nov 30, 2026
RepositoryPHP
PHPMailer/PHPMailer

The classic email sending library for PHP

22.4k
Nov 29, 2026
RepositoryPHP
bcit-ci/CodeIgniter

Open Source PHP Framework (originally from EllisLab)

18.1k
Jul 15, 2024
RepositoryPHP
phpstan/phpstan

PHP Static Analysis Tool - discover bugs in your code without running it!

14.2k
Dec 1, 2026
RepositoryJava
googlesamples/android-play-safetynet

Samples for the Google SafetyNet Attestation API

293
Jul 27, 2022
Repository
centminmod/validate-emails

Self-hosted email verification script to clean up bad invalid email address lists. Supports various commercial email verification provider APIs all in one script

103
Jun 24, 2026
RepositoryTypeScript
morluto/rea

Reverse engineer anything with agents, from app behavior down to native binaries.

487.0k
Dec 2, 2026