PHPackages                             rayhughes/sendgrid-validation - 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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. rayhughes/sendgrid-validation

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

rayhughes/sendgrid-validation
=============================

A PHP library to validate email addresses using the Twilio SendGrid Email Validation API.

1.2.1(1y ago)01.5kMITPHPPHP &gt;=7.4

Since Sep 21Pushed 1y agoCompare

[ Source](https://github.com/RayHughes/sendgrid-validation)[ Packagist](https://packagist.org/packages/rayhughes/sendgrid-validation)[ RSS](/packages/rayhughes-sendgrid-validation/feed)WikiDiscussions main Synced today

READMEChangelog (5)Dependencies (3)Versions (6)Used By (0)

sendgrid-validation
===================

[](#sendgrid-validation)

[![Packagist](https://camo.githubusercontent.com/9da607099c603801eb24b39796fe79c6ae39dae77fb3fc0d7a77394bc7f7e236/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7261796875676865732f73656e64677269642d76616c69646174696f6e2e737667)](https://packagist.org/packages/rayhughes/sendgrid-validation)[![Minimum PHP Version](https://camo.githubusercontent.com/0e9ac047546796cfdbe1423d1f4d91c8f37d2fbb11614a7900bb7686aaa5401f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230372e342d3838393242462e737667)](https://php.net/)[![Licensed under the MIT License](https://camo.githubusercontent.com/08cef40a9105b6526ca22088bc514fbfdbc9aac1ddbf8d4e6c750e3a88a44dca/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d626c75652e737667)](https://github.com/RayHughes/moneypot-api/blob/master/LICENSE)

A PHP library to validate email addresses using the Twilio SendGrid [Email Validation API](https://docs.sendgrid.com/ui/managing-contacts/email-address-validation).

Prerequisites
-------------

[](#prerequisites)

- Twilio SendGrid [Email Validation API Key](https://docs.sendgrid.com/ui/managing-contacts/email-address-validation#generating-your-email-validation-api-key)
- PHP 7.4 or greater
- [Composer](http://getcomposer.org/)

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

[](#installation)

```
composer require rayhughes/sendgrid-validation
```

Usage
-----

[](#usage)

### Basic

[](#basic)

`EmailValidation()` initialized with default thresholds.

```
use SendGridValidation\EmailValidation;
use SendGridValidation\Repository\SendGridApiRepository;

$validation = new EmailValidation(new SendGridApiRepository('api-key'));

$emailValid = $validation->validate('email@example.com'));

echo $emailValid->isValid; // true
echo $emailValid->isValidRisk; // true
echo $emailValid->isValidScore; // true
echo $emailValid->isDisposable; // false
echo $emailValid->hasSuggestion; //false
echo $emailValid->suggestion; // null
```

`EmailValidation()->validate()` returns an instance of `EmailValidationDto()`

#### EmailValidationDto()

[](#emailvalidationdto)

- `$isValid` - Calculated `true` if validation result meets specified thresholds.
- `$isValidRisk` - Calculated `true` specified risk criteria
- `$isValidScore` - Calculated `true` if within minimum score threshold.
- `$isDisposable` - Calculated `true` if an email is considered to be disposable.
- `$hasSuggestion` - Calculated `true` if a suggestion is available.
- `$suggestion` - Calculated email suggestion if available.

```
class EmailValidationDto
{
    public bool $isValid = false;

    public bool $isValidRisk = false;

    public bool $isValidScore = false;

    public bool $isDisposable = false;

    public bool $hasSuggestion = false;

    public ?string $suggestion = null;
}
```

### Advanced

[](#advanced)

`EmailValidation()` can be initialized with optional parameters to validate against developer specified thresholds.

- `$allowRisky` - When `true`, considers risky emails `valid` if other conditions are met.
- `$allowDisposable`- When `true`, considers disposable emails `valid` if other conditions are met.
- `$checkValidScore` - When `true`, checks SendGrid `valid` emails against the minimum score threshold.
- `$minSCore` - Default `0.30`. considers emails `invalid` if the minimum score threshold is not met.

```
use SendGridValidation\EmailValidation;
use SendGridValidation\Repository\SendGridApiRepository;

$validation = new EmailValidation(
    new SendGridApiRepository($apiKey),
    true, // bool $allowRisky = true,
    true, // bool $allowDisposable = true,
    true, // bool $checkValidScore = false,
    EmailValidation::MIN_SCORE // float $minScore = self::MIN_SCORE (0.30)
);

$emailValid = $validation->validate($email);
```

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance36

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 71.4% 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 ~291 days

Total

5

Last Release

581d ago

PHP version history (2 changes)1.0.0PHP ^7.4

1.2.0PHP &gt;=7.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4381883?v=4)[Ray Hughes](/maintainers/rayhughes)[@RayHughes](https://github.com/RayHughes)

---

Top Contributors

[![RayHughes](https://avatars.githubusercontent.com/u/4381883?v=4)](https://github.com/RayHughes "RayHughes (5 commits)")[![SharpEV](https://avatars.githubusercontent.com/u/106425039?v=4)](https://github.com/SharpEV "SharpEV (2 commits)")

---

Tags

sendgridtwilio sendgridemail validationsendGrid email validationvalidation api

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/rayhughes-sendgrid-validation/health.svg)

```
[![Health](https://phpackages.com/badges/rayhughes-sendgrid-validation/health.svg)](https://phpackages.com/packages/rayhughes-sendgrid-validation)
```

###  Alternatives

[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.3k543.5M2.6k](/packages/aws-aws-sdk-php)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k656.1k38](/packages/neuron-core-neuron-ai)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3741.3M46](/packages/tencentcloud-tencentcloud-sdk-php)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[files.com/files-php-sdk

Files.com PHP SDK

2481.1k](/packages/filescom-files-php-sdk)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

252.5k](/packages/eslazarev-wildberries-sdk)

PHPackages © 2026

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