Skip to content

brainfab/email-verification

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Email Verification

Installation

Require this package with composer:

composer require brainfab/email-verification

Usage example:

<?php

require_once 'vendor/autoload.php';

use Brainfab\EmailVerify\EmailVerify;
use Brainfab\EmailVerify\Provider\WhoisxmlapiProvider;

$apiKey = '';//your whoisxmlapi.com API key
$email = 'support@whoisxmlapi.com';//The email address to be verified.

$provider = new WhoisxmlapiProvider($apiKey);//create provider instance
$emailVerify = new EmailVerify($provider);

$result = $emailVerify->verify($email);

var_dump(
    $result->getEmail(),
    $result->getFormatCheck(),
    $result->getSmtpCheck(),
    $result->getDnsCheck(),
    $result->getFreeCheck(),
    $result->getDisposableCheck(),
    $result->getCatchAllCheck(),
    $result->getMxRecords()
);

List of available providers:

  • whoisxmlapi.com - Brainfab\EmailVerify\Provider\WhoisxmlapiProvider
  • hunter.io - Brainfab\EmailVerify\Provider\HunterProvider