addrly/addrly-php

Official PHP SDK for the Addrly email validation API

Maintainers

Package info

github.com/Addrlyq/addrly-php

Homepage

pkg:composer/addrly/addrly-php

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

dev-main 2026-04-25 02:12 UTC

This package is auto-updated.

Last update: 2026-04-25 02:38:59 UTC


README

Official PHP SDK for the Addrly email validation API.

Install

composer require addrly/addrly-php

Quick Start

<?php
require_once 'vendor/autoload.php';

$client = new \Addrly\Addrly('sk_your_api_key');

// Validate an email
$result = $client->validateEmail('user@example.com');
echo $result['mx'];         // true
echo $result['disposable'];  // false

// Validate a domain
$domain = $client->validateDomain('example.com');

// Auto-detect (email or domain)
$auto = $client->validate('test@gmail.com');

Bulk Validation

// Bulk email validation (Pro: 500, Ultra: 1000)
$bulk = $client->bulkValidateEmails([
    'user1@gmail.com',
    'user2@yahoo.com',
    'spam@tempmail.com',
]);
print_r($bulk['summary']);

// Bulk domain validation
$domains = $client->bulkValidateDomains(['gmail.com', 'tempmail.com']);

Gates

$decision = $client->gate('gate_abc123def456', [
    'email' => 'user@tempmail.com',
]);
echo $decision['decision']['action']; // "block"

Error Handling

use Addrly\AddrlyException;

try {
    $result = $client->validateEmail('test@example.com');
} catch (AddrlyException $e) {
    echo $e->getStatus();    // 429
    echo $e->getError();     // "Rate limit exceeded"
    print_r($e->getResponse());
}

Requirements

  • PHP 7.4+
  • ext-curl
  • ext-json
  • No external dependencies