Skip to content

Addrlyq/addrly-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Addrly PHP SDK

Official PHP SDK for the Addrly email validation API.

Install

composer require addrlyq/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

About

Official PHP SDK for Addrly — email validation API with disposable detection, MX checks, and domain verification.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages