dietercoopman / mailspfchecker
A package to check if you can send e-mail through a given mailserver in name of a given e-mail address
Installs: 2 490
Dependents: 2
Suggesters: 0
Security: 0
Stars: 145
Watchers: 2
Forks: 8
Open Issues: 2
Requires
- php: ^8.0|^8.1
- illuminate/contracts: ^8.0|^9.0|^10|^11.0
- mlocati/spf-lib: ^3.1
- spatie/laravel-package-tools: ^1.9.2
Requires (Dev)
- nunomaduro/collision: ^6.0
- nunomaduro/larastan: ^2.0.1
- orchestra/testbench: ^6.15
- pestphp/pest: ^1.21
- pestphp/pest-plugin-laravel: ^1.1
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- phpunit/phpunit: ^9.5
This package is auto-updated.
Last update: 2024-11-08 23:35:44 UTC
README
A Laravel package to check if you can send e-mail through a given mailserver in name of a given e-mail address
Mail spf checker
A Laravel package to check if your application can send e-mail in name of a given address.
Use case
Most of the web applications are sending mails. Mostly through a local mail server or an external mailing service.
When sending in name of a domain without using the legitimate mailserver 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
gives you the possibility to check if you can send with a given from address using the mailserver specified in your mail config
or a given mailserver. It also gives the possibility to retrieve a dns txt record to configure your dns.
Compatibility
This package can be installed in Laravel 6,7,8,9 and 10
Installation
composer require dietercoopman/mailspfchecker
Examples
Using the mailserver used by your application
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 }
Using a given mailserver
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 }
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.