承接 tempmailchecker/php-sdk 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

tempmailchecker/php-sdk

Composer 安装命令:

composer require tempmailchecker/php-sdk

包简介

PHP SDK for TempMailChecker API - Detect disposable email addresses in real-time

README 文档

README

TempMailChecker PHP SDK

TempMailChecker PHP SDK

Latest Release License PHP Version GitHub stars

Detect disposable email addresses in real-time with the TempMailChecker API. Block fake signups, prevent spam, and protect your platform from abuse.

🚀 Quick Start

Installation

composer require tempmailchecker/php-sdk

Basic Usage

<?php

require 'vendor/autoload.php';

use TempMailChecker\TempMailChecker;

// Initialize with your API key
$checker = new TempMailChecker('your_api_key_here');

// Check if an email is disposable
if ($checker->isDisposable('user@tempmail.com')) {
    echo "Blocked: This is a disposable email";
} else {
    echo "Valid: This is a legitimate email";
}

📖 Documentation

Check Email Address

$checker = new TempMailChecker('your_api_key');

// Simple boolean check
$isDisposable = $checker->isDisposable('test@10minutemail.com');

// Get full response
$result = $checker->check('user@example.com');
// Returns: ['temp' => false]

Check Domain

// Check just the domain
$isDisposable = $checker->isDisposableDomain('tempmail.com');

// Get full response
$result = $checker->checkDomain('guerrillamail.com');

Regional Endpoints

Use regional endpoints for lower latency. All endpoints use /check and /usage directly (no /api prefix):

use TempMailChecker\TempMailChecker;

// EU endpoint (default)
$checker = new TempMailChecker('your_api_key');
// or explicitly:
$checker = new TempMailChecker('your_api_key', TempMailChecker::ENDPOINT_EU);

// US endpoint
$checker = new TempMailChecker('your_api_key', TempMailChecker::ENDPOINT_US);

// Asia endpoint
$checker = new TempMailChecker('your_api_key', TempMailChecker::ENDPOINT_ASIA);

Check Usage

$usage = $checker->getUsage();
// Returns: ['usage_today' => 15, 'limit' => 25, 'reset' => 'midnight UTC']

Error Handling

use TempMailChecker\TempMailChecker;
use Exception;

try {
    $isDisposable = $checker->isDisposable('user@example.com');
} catch (Exception $e) {
    if (strpos($e->getMessage(), 'Rate limit') !== false) {
        // Handle rate limit
    } else {
        // Handle other errors
        echo "Error: " . $e->getMessage();
    }
}

🎯 Use Cases

  • Block Fake Signups: Stop disposable emails at registration
  • Prevent Promo Abuse: Protect referral programs and coupons
  • Clean Email Lists: Remove throwaway addresses from newsletters
  • Reduce Spam: Filter out disposable emails in contact forms
  • Protect Communities: Ensure real users in forums and chat

⚡ Features

  • Simple API: One method call, one boolean response
  • Fast: Sub-millisecond processing, ~70ms real-world latency
  • Massive Database: 277,000+ disposable email domains
  • Auto-Updates: Database updated daily automatically
  • Regional Endpoints: US, EU, and Asia for optimal performance
  • Free Tier: 25 requests/day, no credit card required

🔑 Get Your API Key

  1. Sign up at tempmailchecker.com
  2. Get 25 free requests per day
  3. Start blocking disposable emails immediately

📚 Examples

Laravel Integration

namespace App\Services;

use TempMailChecker\TempMailChecker;
use Exception;

class EmailValidationService
{
    private $checker;
    
    public function __construct()
    {
        $apiKey = config('services.tempmailchecker.key');
        if (empty($apiKey)) {
            throw new Exception('TempMailChecker API key not configured');
        }
        $this->checker = new TempMailChecker($apiKey);
    }
    
    public function validateEmail(string $email): bool
    {
        try {
            return !$this->checker->isDisposable($email);
        } catch (Exception $e) {
            \Log::warning('TempMailChecker API error: ' . $e->getMessage());
            return true; // Fail open
        }
    }
}

Symfony Integration

// services.yaml
services:
    TempMailChecker\TempMailChecker:
        arguments:
            $apiKey: '%env(TEMPMAILCHECKER_API_KEY)%'

WordPress Plugin

use TempMailChecker\TempMailChecker;
use Exception;

add_filter('registration_errors', function($errors, $sanitized_user_login, $user_email) {
    try {
        $checker = new TempMailChecker(get_option('tempmailchecker_api_key'));
        
        if ($checker->isDisposable($user_email)) {
            $errors->add('disposable_email', 'Disposable email addresses are not allowed.');
        }
    } catch (Exception $e) {
        // Log error but don't block registration
        error_log('TempMailChecker error: ' . $e->getMessage());
    }
    
    return $errors;
}, 10, 3);

🛠️ Requirements

  • PHP 7.4 or higher
  • cURL extension
  • JSON extension
  • Composer (for installation)

📝 License

This library is open-source software licensed under the MIT License.

🤝 Support

⭐ Why TempMailChecker?

  • 277,000+ domains in our database
  • Sub-millisecond API processing
  • ~70ms latency from global endpoints
  • Auto-updates daily
  • Free tier with 25 requests/day
  • No SDK dependencies - works with any PHP version

Made with ❤️ by TempMailChecker

tempmailchecker/php-sdk 适用场景与选型建议

tempmailchecker/php-sdk 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2 次下载、GitHub Stars 达 1, 最近一次更新时间为 2025 年 12 月 18 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「api」 「email」 「validation」 「sdk」 「spam」 「temporary」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 tempmailchecker/php-sdk 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 tempmailchecker/php-sdk 我们能提供哪些服务?
定制开发 / 二次开发

基于 tempmailchecker/php-sdk 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 2
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 23
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-12-18