drinks-it / hippo-email-validator
Library for validating email address with emailhippo service
2.3
2024-11-29 09:57 UTC
Requires
- php: ^7.4.9 || ^8.0 || ^8.1 || ^8.2
- psr/log: ^1.1
- symfony/http-client: ^5.1 || ^6.0
This package is not auto-updated.
Last update: 2025-06-27 13:05:12 UTC
README
This library provides a simple wrapper around the Email Hippo API for validating email addresses. It allows you to verify that an address exists and meets a minimum reputation score before you accept it in your application.
Installation
Install the package via Composer:
composer require drinks-it/hippo-email-validator
Basic Usage
use Nrgone\EmailHippo\Validator\Config; use Nrgone\EmailHippo\Validator\Validator; use Symfony\Component\HttpClient\HttpClient; use Psr\Log\NullLogger; $config = new Config( true, // enable validation 'https://api.emailhippo.com/v3', // API URL 'your-api-key', // API key 0.7, // minimum hippo trust score false // disable request logging ); $validator = new Validator($config, HttpClient::create(), new NullLogger()); if ($validator->isValid('test@example.com')) { echo 'Email is valid'; } else { echo 'Invalid email'; }