PHP code example of phpmailer / dkimvalidator

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

    

phpmailer / dkimvalidator example snippets


use PHPMailer\DKIMValidator\Validator;
use PHPMailer\DKIMValidator\DKIMException;
/don't copy & paste it as that will likely affect line breaks & charsets
$message  = file_get_contents('message.eml');
$dkimValidator = new Validator($message);
try {
    if ($dkimValidator->validateBoolean()) {
        echo "Cool, it's valid";
    } else {
        echo 'Uh oh, dodgy email!';
    }
} catch (DKIMException $e) {
    echo $e->getMessage();
}