library email-checker
Check if email addresses exist on a mail server over SMTP using ReactPHP's famous non-blocking event loop
flow/email-checker
Check if email addresses exist on a mail server over SMTP using ReactPHP's famous non-blocking event loop
- Wednesday, November 6, 2013
- by stephenfrank
- Repository
- 3 Watchers
- 1 Stars
- 522 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 0 Forks
- 0 Open issues
- 11 Versions
- 0 % Grown
EmailChecker
EmailChecker connects to mail servers over SMTP and asks them to verify email addresses. The library uses ReactPHP's event-driven IO layer to handle all the socket communication., (*1)
Key features:, (*2)
-
N connections are opened concurrently and handled asyncronously thanks to ReactPHP.
- Connections are pooled and kept alive so that multiple requests to the same domain are handled efficiently.
Caveats:, (*3)
- SMTP servers respond with any old random response and can't be trusted especially when requesting a mailbox's RCPT (though this approach is better than nothing).
- MX records are resolved using
getmxrr() and therefore that operation is blocking.
To do:, (*4)
- Implement
React/DNS when is supports MX record resolution.
- Unit test all of the things.
Example:
use Flow\EmailChecker\ConnectionPool;
use Flow\EmailChecker\MailboxUser;
$loop = React\EventLoop\Factory::create();
$emails = array(
'stephen@flowsa.com',
'i-dont-exist-asdf-1234@gmail.com'
);
$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();
dev-master
9999999-dev
Check if email addresses exist on a mail server over SMTP using ReactPHP's famous non-blocking event loop
Sources
Download
MIT
The Requires
by
Stephen Frank
0.3.0
0.3.0.0
Check if email addresses exist on a mail server over SMTP using ReactPHP's famous non-blocking event loop
Sources
Download
MIT
The Requires
by
Stephen Frank
0.2.2
0.2.2.0
Check if email addresses exist on a mail server over SMTP using ReactPHP's famous non-blocking event loop
Sources
Download
MIT
The Requires
by
Stephen Frank
0.2.1
0.2.1.0
Check if email addresses exist on a mail server over SMTP using ReactPHP's famous non-blocking event loop
Sources
Download
MIT
The Requires
by
Stephen Frank
0.2.0
0.2.0.0
Check if email addresses exist on a mail server over SMTP using ReactPHP's famous non-blocking event loop
Sources
Download
MIT
The Requires
by
Stephen Frank
0.1.4
0.1.4.0
Check if email addresses exist on a mail server over SMTP using ReactPHP's famous non-blocking event loop
Sources
Download
MIT
The Requires
by
Stephen Frank
0.1.5
0.1.5.0
Check if email addresses exist on a mail server over SMTP using ReactPHP's famous non-blocking event loop
Sources
Download
MIT
The Requires
by
Stephen Frank
0.1.3
0.1.3.0
Check if email addresses exist on a mail server over SMTP using ReactPHP's famous non-blocking event loop
Sources
Download
MIT
The Requires
by
Stephen Frank
0.1.2
0.1.2.0
Check if email addresses exist on a mail server over SMTP using ReactPHP's famous non-blocking event loop
Sources
Download
MIT
The Requires
by
Stephen Frank
0.1.0
0.1.0.0
Check if email addresses exist on a mail server over SMTP using ReactPHP's famous non-blocking event loop
Sources
Download
MIT
The Requires
by
Stephen Frank
0.1.1
0.1.1.0
Check if email addresses exist on a mail server over SMTP using ReactPHP's famous non-blocking event loop
Sources
Download
MIT
The Requires
by
Stephen Frank