PHP code example of flow / email-checker

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

    

flow / email-checker example snippets


use Flow\EmailChecker\ConnectionPool;
use Flow\EmailChecker\MailboxUser;

$loop = React\EventLoop\Factory::create();

$emails = array(
    '[email protected]',
    '[email protected]'
);

$connectionPool = new ConnectionPool($loop, 'flowsa.com', 'stephen', function (ConnectionPool $pool) use (& $emails) {
    $email = array_shift($emails);

    if (!$email) {
        return false; // Returning false will cause the connection pool to drain and eventually die
    }

    $pool->add(
        $email,
        function (MailboxUser $email) { // Bind in a closure for the callback that occurs after an email is resolved
            echo $email->getEmail() . ($email->exists() ? ' exists' : ' does not exist') . "\n";
        }
    );

}, function ($str) {
    echo "$str\n";
});

$connectionPool->setConcurrency(10);
$connectionPool->run();