PHP code example of mailboxvalidator / mailboxvalidator-yii

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

    

mailboxvalidator / mailboxvalidator-yii example snippets


'mbvAPIKey' => 'PASTE_YOUR_API_KEY_HERE',

$mbv = new EmailValidation('PASTE_YOUR_API_KEY_HERE');

['email', MailboxValidator::className(), 'option'=>'YOUR_SELECTED_OPTION','api_key'=>'PASTE_YOUR_API_KEY_HERE',],

use MailboxValidator\MailboxValidator;

['YOUR_EMAIL_FIELD_NAME', MailboxValidator::className(), 'option'=>'disposable,free',],

use MailboxValidator\EmailValidation;

$mbv = new EmailValidation(Yii::$app->params['mbvAPIKey']);
$results = $mbv->isFreeEmail('[email protected]');

return $this->render('YOUR_VIEW_NAME', ['results' => $results]);

echo 'email_address = ' . $results->email_address . "<br>";