PHP code example of pcf / disposable-email

1. Go to this page and download the library: Download pcf/disposable-email 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/ */

    

pcf / disposable-email example snippets




CF\DisposableEmail\ListedVerifier;
use PCF\DisposableEmail\SimpleDomainCollection;
use PCF\DisposableEmail\Resource\AbstractResourceList;

$collection = new SimpleDomainCollection();
$collection->setBlockedList(AbstractResourceList::getList('block'));
$collection->setTrustedList(AbstractResourceList::getList('trust'));
$collection->setKnownList([
    //Add domains that you know, if you want
]);

$verifier = new ListedVerifier($collection);

$mail = '[email protected]';
$domain = trim(strstr($mail, '@'), '@');

$status = $verifier->verifyDomain($domain); //It should return ListedVerifier::DOMAIN_UNKNOWN