PHP code example of gamalan / emaillistverify-api

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

    

gamalan / emaillistverify-api example snippets


use Gamalan\EmailListVerify\EmailListVerify;
use Gamalan\EmailListVerify\SingleResult;

// You can configure timeout by using parameter, default is 15
$client = new EmailListVerify('API_KEY', 30);

try{
    $result = $client->verifyEmail('[email protected]');
    switch ($result->getStatus()){
        case SingleResult::VALIDATION_OK:
            // Do something
            break;
        case SingleResult::VALIDATION_ANTISPAM_SYSTEM:
            // Do somethin else
            break;
        default:
            break;
    }
}catch (\Gamalan\EmailListVerify\APIError $error){
    // Handle Error
}