PHP code example of domainvalidity / php-email-signals

1. Go to this page and download the library: Download domainvalidity/php-email-signals library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

domainvalidity / php-email-signals example snippets


use DomainValidity\EmailSignals\Factory;

// Every bundled check, fully wired: discovered HTTP client and cache,
// downloaded community lists, DNS behind a one-hour cache
$pipeline = Factory::batteriesIncluded();

$report = $pipeline->inspect('[email protected]');

$report->labels();                              // every label that matched
$report->signalOrFail('mx')->fact('has_mx');    // true
$report->address()->canonical();                // '[email protected]'
$report->toArray();                             // persist it next to the record

$refuseSignup = $report->hasLabel('disposable') || $report->hasLabel('no-mx');
bash
composer