PHPackages                             kbv-vcos/mailspfchecker - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Mail &amp; Notifications](/categories/mail)
4. /
5. kbv-vcos/mailspfchecker

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

kbv-vcos/mailspfchecker
=======================

A package to check if you can send e-mail through a given mailserver in name of a given e-mail address

v1.0.101(4w ago)0136↑142.6%MITPHPPHP ^8.0|^8.1

Since May 12Pushed 4w agoCompare

[ Source](https://github.com/kbv-vcos/mailspfchecker)[ Packagist](https://packagist.org/packages/kbv-vcos/mailspfchecker)[ Docs](https://github.com/dietercoopman/mailspfchecker)[ RSS](/packages/kbv-vcos-mailspfchecker/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (2)Dependencies (12)Versions (3)Used By (0)

[![showsql](https://camo.githubusercontent.com/a68bdc414c1c2f6c9fc6fea19fe5ec1d2b81acd215ad50a874b3ac33e3ec84d8/68747470733a2f2f62616e6e6572732e6265796f6e64636f2e64652f6d61696c737066636865636b65722e706e673f7468656d653d6c69676874267061636b6167654d616e616765723d636f6d706f7365722b72657175697265267061636b6167654e616d653d646965746572636f6f706d616e2532466d61696c737066636865636b6572267061747465726e3d617263686974656374267374796c653d7374796c655f31266465736372697074696f6e3d412b4c61726176656c2b7061636b6167652b746f2b636865636b2b69662b796f75722b6170706c69636174696f6e2b63616e2b73656e642b652d6d61696c2b696e2b6e616d652b6f662b612b676976656e2b616464726573732e266d643d312673686f7757617465726d61726b3d3126666f6e7453697a653d313030707826696d616765733d68747470732533412532462532466c61726176656c2e636f6d253246696d672532466c6f676f6d61726b2e6d696e2e737667)](https://camo.githubusercontent.com/a68bdc414c1c2f6c9fc6fea19fe5ec1d2b81acd215ad50a874b3ac33e3ec84d8/68747470733a2f2f62616e6e6572732e6265796f6e64636f2e64652f6d61696c737066636865636b65722e706e673f7468656d653d6c69676874267061636b6167654d616e616765723d636f6d706f7365722b72657175697265267061636b6167654e616d653d646965746572636f6f706d616e2532466d61696c737066636865636b6572267061747465726e3d617263686974656374267374796c653d7374796c655f31266465736372697074696f6e3d412b4c61726176656c2b7061636b6167652b746f2b636865636b2b69662b796f75722b6170706c69636174696f6e2b63616e2b73656e642b652d6d61696c2b696e2b6e616d652b6f662b612b676976656e2b616464726573732e266d643d312673686f7757617465726d61726b3d3126666f6e7453697a653d313030707826696d616765733d68747470732533412532462532466c61726176656c2e636f6d253246696d672532466c6f676f6d61726b2e6d696e2e737667)

[![Latest Version on Packagist](https://camo.githubusercontent.com/2b61bd913e69a68abcd6473a6ce1a474eaacb7a629cb0bbd7030fa0ed9e256be/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f646965746572636f6f706d616e2f6d61696c737066636865636b65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/dietercoopman/mailspfchecker)[![Total Downloads](https://camo.githubusercontent.com/6246ff4e5b85b850422766f8eec5d2d7772a40120c99667216a11cffdaecca2a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f646965746572636f6f706d616e2f6d61696c737066636865636b65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/dietercoopman/mailspfchecker)

A Laravel package to check if you can send e-mail through a given mailserver in name of a given e-mail address
==============================================================================================================

[](#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
================

[](#mail-spf-checker)

A Laravel package to check if your application can send e-mail in name of a given address.

Use case
--------

[](#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
-------------

[](#compatibility)

This package can be installed in Laravel 6,7,8,9 and 10

Installation
------------

[](#installation)

```
composer require dietercoopman/mailspfchecker
```

Examples
--------

[](#examples)

### Using the mailserver used by your application

[](#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

[](#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
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Dieter Coopman](https://github.com/dietercoopman)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

43

—

FairBetter than 89% of packages

Maintenance94

Actively maintained with recent releases

Popularity15

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 56.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

28d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/103108236?v=4)[kbv-vcos](/maintainers/kbv-vcos)[@kbv-vcos](https://github.com/kbv-vcos)

---

Top Contributors

[![dietercoopman](https://avatars.githubusercontent.com/u/4672752?v=4)](https://github.com/dietercoopman "dietercoopman (37 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (16 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (10 commits)")[![kbv-vcos](https://avatars.githubusercontent.com/u/103108236?v=4)](https://github.com/kbv-vcos "kbv-vcos (2 commits)")[![lloricode](https://avatars.githubusercontent.com/u/8251344?v=4)](https://github.com/lloricode "lloricode (1 commits)")

---

Tags

laraveldietercoopmanmailspfchecker

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/kbv-vcos-mailspfchecker/health.svg)

```
[![Health](https://phpackages.com/badges/kbv-vcos-mailspfchecker/health.svg)](https://phpackages.com/packages/kbv-vcos-mailspfchecker)
```

###  Alternatives

[spatie/laravel-pdf

Create PDFs in Laravel apps

1.0k4.3M41](/packages/spatie-laravel-pdf)[spatie/laravel-health

Monitor the health of a Laravel application

88011.3M149](/packages/spatie-laravel-health)[vormkracht10/laravel-mails

Laravel Mails can collect everything you might want to track about the mails that has been sent by your Laravel app.

24655.3k](/packages/vormkracht10-laravel-mails)[xammie/mailbook

Laravel Mail Explorer

482519.8k1](/packages/xammie-mailbook)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3913.7k](/packages/rawilk-profile-filament-plugin)[backstage/laravel-mails

Laravel Mails can collect everything you might want to track about the mails that has been sent by your Laravel app.

24675.5k8](/packages/backstage-laravel-mails)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
