Email validation · Integrations · PHP

Integration guide

Email validation in PHP.

Validate any email address from PHP with one API call using cURL or Guzzle. Working code, the real JSON response shape, error handling, and where the call belongs in a Laravel or Symfony project.

In this guide

Endpoint1 POST
Median responseSub-1s
Free tier100 / month
Standard plan$49.99 / 50,000

How do I validate an email with PHP?

No SDK to install. cURL ships with PHP, and Guzzle is already in most Laravel and Symfony projects.

PHP, with Guzzle

use GuzzleHttp\Client; function validateEmail(string $email): array { $client = new Client([ 'base_uri' => 'https://api.trueguard.io', 'timeout' => 5.0, ]); $res = $client->post('/v2/email/validation', [ 'headers' => ['X-API-KEY' => getenv('TRUEGUARD_KEY')], 'json' => ['email' => $email], ]); return json_decode((string) $res->getBody(), true); } $result = validateEmail('founder@yourcompany.com'); if ($result['deliverability']['status'] === 'invalid') { // reject the submission }

One header, one body field

Set X-API-KEY to your key and POST a JSON body with a single email field. HTTPS only. The response carries the seven signals plus one deliverability status.

Response fields you will branch on

deliverability.status

safe, risky, invalid or unknown. This is the field to branch on.

syntax.isValid

RFC 5322 format check. Deterministic, so a false here is always a typo or a malformed address.

quality.isDisposable

True for throwaway providers. Usually a hard block at signup.

deliverability.isCatchall

True when the domain accepts any address. The status is then risky, unless a second check confirmed or ruled out the mailbox.

quality.isRole

info@, support@, sales@. Route these differently rather than rejecting them.

Run it once before you write any code.

The same endpoint the snippet above calls. 10 free checks a day, no key needed.

Or try

Where should the call live in a PHP app?

Your API key is a secret. Where you put this call decides whether it stays one.

In a view or inline in a form template

Keep the key out of anything rendered and out of version control. Calling the endpoint from template code also makes the request impossible to cache, test or rate-limit sensibly.

In a service class, called from your controller

A Laravel form request rule or a Symfony validator constraint is the natural home. Read the key from the environment, call the service, and branch on the status before the model is persisted.

What the endpoint returns

{ "email": "founder@yourcompany.com", "rawEmail": "founder@yourcompany.com", "syntax": { "isValid": true }, "deliverability": { "status": "safe", "isSmtpValid": true, "isMxValid": true, "isCatchall": false, "isInboxFull": false, "isDeliverable": true, "isDisabled": false, "mxRecords": ["mx1.yourcompany.com", "mx2.yourcompany.com"] }, "domain": { "name": "yourcompany.com", "age": 2841, "isLive": true, "isRisky": false }, "quality": { "isDisposable": false, "isFree": false, "isRole": false, "isSubaddress": false } }

How do I handle errors and rate limits in PHP?

use GuzzleHttp\Exception\RequestException; try { $result = validateEmail($email); } catch (RequestException $e) { $status = $e->getResponse()?->getStatusCode(); if ($status === 429) { // quota or rate limit: allow with a flag return allowWithFlag($email); } if ($status === 401) { Log::error('Trueguard key rejected'); } return allowWithFlag($email); }

Status

What to do

200

Validation ran. Read deliverability.status and branch.

400

Malformed request body. Check you are sending JSON with an email field.

401

Missing or rejected API key. Log it loudly: every request is failing.

429

Rate limit or monthly quota reached. Allow the user through with a flag and alert yourself; do not block real signups on your own quota.

5xx

Retry once with a short backoff, then fall back to allowing with a flag.

Which PHP frameworks does this work with?

It is one HTTPS request, so anything that can make one works. These are the stacks people ask about.

LaravelSymfonyWordPress pluginsSlimCodeIgniterMagentoPlain PHP with cURL

Laravel validation rule

Wrap the call in a custom rule and add it to your registration form request, so an invalid address returns a normal validation error.

WordPress registration hook

Hook into registration_errors, call the API with wp_remote_post, and reject throwaway addresses before WordPress creates the user.

CSV cleanup command

Write an Artisan or Symfony console command that reads a CSV, validates each row, and writes the status next to it. Retry on 429.

Symfony constraint

Add a custom constraint to the email field of your signup form, so the check runs wherever the form is validated and the key stays in .env.

What it costs once you ship.

Three tiers. The free plan needs no card and runs the production endpoint.

Free

$0 forever

100 validations / month

Overage: n/a

Get started free

Standard

Popular

$49.99 / month

50,000 validations / month

Overage: $0.001 per validation

Get your API key

Custom

Contact us

500,000+ validations / month

Overage: Negotiated

Talk to us

Frequently asked questions

The full field reference lives in the API documentation.

cURL or Guzzle?

Guzzle if your project already has it, which covers most Laravel and Symfony apps. Plain cURL is fine and adds no dependency: it is the same single POST either way.

Where does this belong in Laravel?

In a form request rule or a custom validation rule backed by a service class. The verdict is then available before the model is created and the message surfaces on the email field.

Can I use this in a WordPress plugin?

Yes, with wp_remote_post from the server side. Store the key with the plugin's options API, never in front-end script, and hook the check into registration or form submission.

What timeout should I set?

Around 5 seconds. Median response is under a second, but the SMTP step waits on the destination mail server. On timeout, allow with a flag rather than blocking a real signup.

Is there an official PHP SDK?

No. One header, one body field, one status to branch on, so a small service class is all it takes and there is nothing to keep updated.

Validate emails from PHP in minutes.

100 validations a month, free, no card. Working code above, production endpoint, same response shape on every plan.

Get your free API key

No credit card required.

trueguard-logo© 2026 Trueguardinfo@trueguard.io