PHPackages                             mika56/spfcheck - 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. mika56/spfcheck

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

mika56/spfcheck
===============

Checks an IP address against a domain's SPF record

3.0.1(1y ago)451.0M—1.4%27[6 issues](https://github.com/Mika56/PHP-SPF-Check/issues)[1 PRs](https://github.com/Mika56/PHP-SPF-Check/pulls)6MITPHPPHP &gt;=8.1CI passing

Since Jan 5Pushed 1y ago7 watchersCompare

[ Source](https://github.com/Mika56/PHP-SPF-Check)[ Packagist](https://packagist.org/packages/mika56/spfcheck)[ RSS](/packages/mika56-spfcheck/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (5)Versions (18)Used By (6)

PHP-SPF-Check
=============

[](#php-spf-check)

[![CI](https://github.com/Mika56/PHP-SPF-Check/actions/workflows/ci.yml/badge.svg)](https://github.com/Mika56/PHP-SPF-Check/actions/workflows/ci.yml)[![Latest Stable Version](https://camo.githubusercontent.com/d2c6dda2e9291d5071de6b53157fc40580b77d142a725bd0bb32b7e32416a7d8/68747470733a2f2f706f7365722e707567782e6f72672f6d696b6135362f737066636865636b2f762f737461626c65)](https://packagist.org/packages/mika56/spfcheck)[![Total Downloads](https://camo.githubusercontent.com/0dd0c6ff1c7a734901aeccccbc53b46f03e0cda4321eaa6bb29e8ec71cdde7d4/68747470733a2f2f706f7365722e707567782e6f72672f6d696b6135362f737066636865636b2f646f776e6c6f616473)](https://packagist.org/packages/mika56/spfcheck)[![License](https://camo.githubusercontent.com/6fd5ca8df09f8fa600edc708d3d468aae6223b3c1cceaa9fe1df1377179f83f1/68747470733a2f2f706f7365722e707567782e6f72672f6d696b6135362f737066636865636b2f6c6963656e7365)](https://packagist.org/packages/mika56/spfcheck)[![Codacy Badge](https://camo.githubusercontent.com/9447befacec2ea4e5b3b2059ef8f41b0dd851f16e7da746afc5e26cb291ac24e/68747470733a2f2f6170702e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f3034663261336132323163313433303839313236643730663233356135346364)](https://app.codacy.com/gh/Mika56/PHP-SPF-Check/dashboard?utm_source=github.com&utm_medium=referral&utm_content=Mika56/PHP-SPF-Check&utm_campaign=Badge_Grade)[![Codacy Badge](https://camo.githubusercontent.com/fb4cb6b4ae22074877cccedd23751139b98a3a78dacdcbc6b04154781f9b3741/68747470733a2f2f6170702e636f646163792e636f6d2f70726f6a6563742f62616467652f436f7665726167652f3034663261336132323163313433303839313236643730663233356135346364)](https://app.codacy.com/gh/Mika56/PHP-SPF-Check/dashboard?utm_source=github.com&utm_medium=referral&utm_content=Mika56/PHP-SPF-Check&utm_campaign=Badge_Coverage)

Simple library to check an IP address against a domain's [SPF](http://www.openspf.org/) record

Requirements
------------

[](#requirements)

This library requires a supported version of PHP, that is PHP &gt;= 8.1.

Older versions of this library support older versions of PHP. Please note that no bugfixes, no new features, and no support will be provided for older versions.

Library versionMin version of PHPHighest version of PHP15.65.627.48.338.18.4Installation
------------

[](#installation)

This library is available through Composer. Run `composer require "mika56/spfcheck:^3.0"` or add this to your composer.json:

```
{
  "require": {
    "mika56/spfcheck": "^3.0"
  }
}
```

Usage
-----

[](#usage)

Create a new instance of SPFCheck. The constructor requires a DNSRecordGetterInterface to be passed. Included in this library is `DNSRecordGetter`, which uses PHP's DNS function `dns_get_record` to get data. Please take a look at [mika56/spfcheck-dns-direct](https://github.com/Mika56/PHP-SPF-Check-DNS-Direct)if you want to use custom DNS servers.

```
