This library allows you to easily implement mailboxLayer by apiLayer into your project.
- PHP 5.4+
- PHP JSON
- catch_all attribute is of no use with free mailboxLayer account.
see https://mailboxlayer.com/documentation#catch_all
composer require ylly/mailboxLayer
You need to generate a key on mailboxLayer and add it to the configuration.yml
see https://mailboxlayer.com/product
accessKey: generated access key from mailboxLayer
The EmailChecker manage verifications on email addresses
You can set emailChecker with variables
$emailChecker = EmailCheckerFactory::create($accessKey, $proxy);
You can check set emailChecker from a YAML config file by
$emailChecker = EmailCheckerFactory::createFromYamlFile('/path/to/config.yml');
Or from an key-value array of configuration
$emailChecker = EmailCheckerFactory::createFromArray($configArray);
The users email addresses creates url for verifications
$check = $emailChecker->checkEmail($email);
or with catch_all boolean attributes
$check = $emailChecker->checkEmail($email, $catchAll);
A Log interface is provided to manage outputed logs, you can register your listener on the emailChecker
class Listener implement LogListenerInterface
{
public function recieve($level, $message)
{
// do something
}
}
$emailChecker->addListener(new Listener());