Skip to content

EnrowAPI/email-verifier-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Email Verifier - PHP Library

Packagist Version License: MIT GitHub stars Last commit

Verify email addresses in real time. Check deliverability, detect disposable and catch-all domains, and clean your email lists before sending.

Powered by Enrow -- real-time SMTP-level verification with high accuracy on catch-all domains.

Installation

composer require enrow/email-verifier

Requires PHP 8.1+ and Guzzle 7.

Simple Usage

use EmailVerifier\EmailVerifier;

$verification = EmailVerifier::verify('your_api_key', [
    'email' => 'tcook@apple.com',
]);

$result = EmailVerifier::get('your_api_key', $verification['id']);

echo $result['email'];         // tcook@apple.com
echo $result['qualification']; // valid

verify() returns a verification ID. The verification runs asynchronously -- call get() to retrieve the result once it's ready. You can also pass a webhook URL to get notified automatically.

Bulk verification

use EmailVerifier\EmailVerifier;

$batch = EmailVerifier::verifyBulk('your_api_key', [
    'verifications' => [
        ['email' => 'tcook@apple.com'],
        ['email' => 'satya@microsoft.com'],
        ['email' => 'jensen@nvidia.com'],
    ],
]);

// $batch['batchId'], $batch['total'], $batch['status']

$results = EmailVerifier::getBulk('your_api_key', $batch['batchId']);
// $results['results'] -- array of verification results

Up to 5,000 verifications per batch. Pass a webhook URL to get notified when the batch completes.

Error handling

try {
    EmailVerifier::verify('bad_key', [
        'email' => 'test@test.com',
    ]);
} catch (\RuntimeException $e) {
    // $e->getMessage() contains the API error description
    // Common errors:
    // - "Invalid or missing API key" (401)
    // - "Your credit balance is insufficient." (402)
    // - "Rate limit exceeded" (429)
}

Getting an API key

Register at app.enrow.io to get your API key. You get 50 free credits (= 200 verifications) with no credit card required. Each verification costs 0.25 credits.

Paid plans start at $17/mo for 1,000 credits up to $497/mo for 100,000 credits. See pricing.

Documentation

License

MIT -- see LICENSE for details.

About

Verify email addresses for deliverability with catch-all verification — PHP library powered by Enrow

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages