email-verifier/verifier-php
Composer 安装命令:
composer require email-verifier/verifier-php
包简介
VerifyRight Email Verification Library for PHP
README 文档
README
A PHP library for validating emails using the VerifyRight API. Checks for non-existent emails, invalid domains, and disposable email addresses.
Installation
Install via Composer:
composer require email-verifier/verifier-php
Usage
Basic usage:
use EmailVerifier\EmailVerifier; // Initialize with your API token $verifier = new EmailVerifier('YOUR_ACCESS_TOKEN'); // Simple verification (returns true/false) try { $isValid = $verifier->verifyEmail('test@example.com'); } catch (InvalidArgumentException $e) { // Handle invalid email format echo "Invalid email format: " . $e->getMessage(); } catch (RuntimeException $e) { // Handle API errors echo "API error: " . $e->getMessage(); } // Get detailed verification results try { $details = $verifier->verifyEmail('test@example.com', true); /* Returns array with: { "status": "valid", "domain": "example.com", "is_disposable": false, "is_role_account": false } */ } catch (Exception $e) { echo "Error: " . $e->getMessage(); }
Features
- Email format validation
- Domain existence check
- Disposable email detection
- Role account detection
- Detailed verification results
- Modern PHP 7.4+ support
- Exception handling
- PSR-4 autoloading
Requirements
- PHP 7.4 or higher
- curl extension
- json extension
License
MIT License
统计信息
- 总下载量: 2
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 15
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-01-12