• Reading time ~ 1 min
  • 02.09.2022

The Laravel Mail SPF Checker is a package to check if you can send an e-mail through a given mail server in the name of a given e-mail address:

When sending in the name of a domain without using the legitimate mail server of the domain it can get tricky...Most of the time your mail ends up in a spam folder. This can be solved by configuring a correct SPF record for the domain you are sending with.

This package provides a checker that you can use in your app to ensure you have a correct SPF record:

$mailSpfChecker->canISendAs("[email protected]"); // bool
 
// If you cannot send mail correctly, this will output the needed SPF record:
 
if (! $mailSpfChecker->canISendAs("[email protected]")) {
    // Generate a txt-record with a name of dietse.dev
    // and the value v=spf1 ip4:#.#.#.# -all
    echo $mailSpfChecker->howCanISendAs("[email protected]");
}

You can also check using a given mail server:

$mailSpfChecker
    ->using('SMTP.mandrill.com')
    ->canISendAs("[email protected]");

You can get started with this package by checking out the Mail SFP Checker on GitHub.

Comments

No comments yet
Yurij Finiv

Yurij Finiv

Full stack

ABOUT

Professional Fullstack Developer with extensive experience in website and desktop application development. Proficient in a wide range of tools and technologies, including Bootstrap, Tailwind, HTML5, CSS3, PUG, JavaScript, Alpine.js, jQuery, PHP, MODX, and Node.js. Skilled in website development using Symfony, MODX, and Laravel. Experience: Contributed to the development and translation of MODX3 i...

About author CrazyBoy49z
WORK EXPERIENCE
Contact
Ukraine, Lutsk
+380979856297