PHP code example of tomcan / dkimvalidator
1. Go to this page and download the library: Download tomcan/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/ */
tomcan / dkimvalidator example snippets
use TomCan\DKIMValidator\Validator;
use TomCan\DKIMValidator\DKIMException;
sk -
//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();
}