masnathan/email-validator

This is an easy way to check if a email address is acceptable so you can avoid fake/invalid users on your database.

v1.0.0 2021-08-24 15:50 UTC

This package is auto-updated.

Last update: 2024-10-11 14:57:27 UTC


README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

This is an easy way to check if a email address is acceptable so you can avoid fake/invalid users on your database.

What this API does is check if the email address is correctly formatted, is from a disposable or temporary service and the domain is reachable. This way you can filter out spam and one-shot accounts decreasing the rate of fake or invalid accounts on your database.

Request your API key here

Installation

You can install the package via composer:

composer require masnathan/email-validator

Usage

use MASNathan\EmailValidator\EmailValidator;

$emailValidator = new EmailValidator('email-validator8.p.rapidapi.com', 'super-secret-api-key');

$details = $emailValidator->check('some-email@gmail.com');

var_dump($details);
// array:5 [
//   "email" => "some-email@gmail.com"
//   "valid" => true
//   "disposable" => false
//   "mx_records" => true
//   "exists" => null
// ]

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.