PHP code example of dietercoopman / mailspfchecker
1. Go to this page and download the library: Download dietercoopman/mailspfchecker 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/ */
dietercoopman / mailspfchecker example snippets
if ($mailSpfChecker->canISendAs("hello@dietse.dev")) {
// the happy path
} else {
// you can not send e-mail in name of hello@dietse.dev, but I can tell you what to do
echo $mailSpfChecker->howCanISendAs("hello@dietse.be");
// Generate a txt-record with a name of dietse.dev and the value v=spf1 ip4:#.#.#.# -all
}
if ($mailSpfChecker->using('smtp.mandrill.com')->canISendAs("hello@dietse.dev")) {
// the happy path
} else {
// you can not send e-mail in name of hello@dietse.dev, but I can tell you what to do
echo $mailSpfChecker->using('smtp.mandrill.com')->howCanISendAs("hello@dietse.be");
// Generate a txt-record with a name of dietse.dev and the value v=spf1 ip4:spf.mandrill.com -all
}