PHP code example of studiovisual / verifyemail

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

    

studiovisual / verifyemail example snippets




use VerifyEmail\EmailAddressVerifier;
use VerifyEmail\Utils;

$verifier = new EmailAddressVerifier();
$verifier->setMailFrom('[email protected]');
$verifier->setHelloDomain('domain.tld');
$verifier->setValidationLevel(AddressValidationLevel::SendAttempt);
$result = $verifier->verify('[email protected]');

if ($result === AddressValidationLevel::OK) {
    echo 'Email verified';
}

$level = null;
if (EmailAddressVerifier::validate($email, $level)) {
    echo 'Email verified';
}