Download the PHP package pyzit/tempmail without Composer

On this page you can find all versions of the php package pyzit/tempmail. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package tempmail

pyzit/tempmail — PHP SDK

Official PHP client for the Pyzit Disposable Email Detector API. Detect throwaway and temporary email addresses before they reach your database.

PHP


Table of Contents


Requirements

Requirement Version
PHP ≥ 8.1
ext-curl any
ext-json any

No other runtime dependencies.


Installation


Quick Start

Get your API token from the Pyzit dashboard.


Authentication

Pass your API token as the first argument to TempMailClient:

Keep your token secret. The recommended approach is to load it from an environment variable:


Methods

check() — Free Tier

Quick disposable check. Returns in milliseconds.

Parameters

Name Type Description
$email string The email address to check

Returns CheckResult


detailed() — Pro Tier

Full DNS, reputation, and signal analysis. Use this when you need to know why an email is suspicious — not just that it is.

Parameters

Name Type Description
$email string The email address to analyse

Returns DetailedResult

Requires the Pro plan. Throws PlanRequiredException if your account does not have access.


bulk() — Business Tier

Validate up to 100 emails in a single API call. Far more efficient than looping check().

Parameters

Name Type Description
$emails string[] Array of email addresses (max 100)

Returns BulkResult

Requires the Business plan. Throws PlanRequiredException if your account does not have access.


Response Models

All models are immutable value objects with readonly properties. There is no JSON decoding to do — the SDK handles it.

CheckResult

Returned by check().

Property Type Description
$email string The email address that was validated
$isDisposable bool true if the email is disposable
$status string "clean" or "disposable"

Methods

Method Returns Description
isClean() bool Convenience: !$this->isDisposable

DetailedResult

Returned by detailed().

Property Type Description
$email string The email address
$domain string The domain portion
$isDisposable bool Whether the email is disposable
$status string "clean" or "disposable"
$reputationScore float 0.0 (bad) to 1.0 (trusted)
$riskLevel string "low", "medium", or "high"
$recommendation string "accept", "review", or "reject"
$details DetailedDetails Nested analysis object

Methods

Method Returns Description
shouldReject() bool true when recommendation === "reject"

DetailedDetails

Accessible via $result->details.

Property Type Description
$reputation ReputationDetail Reputation scoring
$signals Signals Positive / negative signals
$dnsIntelligence DnsIntelligence DNS record analysis
$stability StabilityInfo Domain age and stability

DnsIntelligence

Property Type Description
$hasMx bool Domain has MX records
$mxRecords MxRecord[] Array of MX record objects
$hasARecord bool Domain has an A record
$hasSpf bool Domain has an SPF record
$hasDmarc bool Domain has a DMARC record
$error ?string DNS lookup error message, or null

MxRecord

Property Type Description
$priority int MX priority (lower = higher priority)
$exchange string Mail exchange hostname
$ips string[] Resolved IP addresses for this host

Signals

Property Type Description
$positive string[] Signals that lower risk
$negative string[] Signals that increase risk
$neutral string[] Informational signals

ReputationDetail

Property Type Description
$reputationScore float 0.0 – 1.0 reputation score
$isDisposable bool Whether classified as disposable
$disposableConfidence float Confidence in the classification
$riskLevel string "low", "medium", or "high"
$recommendation string "accept", "review", "reject"

StabilityInfo

Property Type Description
$stabilityScore float 0.0 – 1.0 domain stability score
$domainAgeDays int Age of the domain in days
$isNewDomain bool true if the domain is newly seen
$riskFactors string[] Risk factor identifiers

BulkResult

Returned by bulk().

Property Type Description
$results array<string, bool> Map of email address → is_disposable
$processed int Number of emails processed

Methods

Method Returns Description
disposableEmails() string[] Only the disposable email addresses
cleanEmails() string[] Only the clean email addresses

Error Handling

All exceptions extend PyzitException, so you can catch everything in one block or handle specific cases:

Exception Reference

Exception HTTP Status Attribute
AuthenticationException 401
ScopeException 403 (scope) getRequiredScope(): string
PlanRequiredException 402 / 403 getRequiredPlan(): string
RateLimitException 429 getRetryAfter(): int (seconds)
ApiException 5xx / other getStatusCode(): int, getResponseBody(): string
TimeoutException

All of the above extend PyzitException which extends \RuntimeException.

Fail-Open Pattern

Never block a legitimate user because your email validation API is temporarily down. Always fail open on SDK errors:


Framework Integration

Laravel

Service Provider binding:

Middleware:

Form Request validation rule:


Symfony

Service configuration (config/services.yaml):

Validator Constraint:


Plain PHP


Configuration

Parameter Type Default Description
$apiToken string Your Pyzit API token
$timeout int 10 cURL timeout in seconds
$baseUrl string https://api-tempmail.pyzit.com/v1 API base URL

Testing

Running the test suite

Output:

Testing your own code

The SDK is designed to be testable. In your own tests, inject a fake or mock TempMailClient rather than making real API calls.

Using a hand-rolled fake:

Using PHPUnit mocks:


Project Structure


API Reference

Full API documentation: https://temp-mail-detector.pyzit.com/docs

Endpoint Method Plan SDK method
/v1/validate/check/ POST Free check()
/v1/validate/detailed/ POST Pro detailed()
/v1/validate/bulk/ POST Business bulk()

License

MIT — see LICENSE for details.


Support


Docker (Recommended)

Docker is the recommended way to work with this SDK. It pins PHP and Composer to exact versions, so the project runs identically on any machine — your laptop, a new PC, a CI server, or a teammate's computer. No PHP or Composer installation is needed on the host.

Prerequisites

First-time setup

Daily workflow

All available commands

Command What it does
.\dev.ps1 install Build image + install Composer dependencies
.\dev.ps1 test Run all PHPUnit tests
.\dev.ps1 test-filter -Filter FooTest Run only tests matching FooTest
.\dev.ps1 shell Open interactive bash shell inside container
.\dev.ps1 example Run example_usage.php
.\dev.ps1 build Rebuild the Docker image
.\dev.ps1 clean Remove containers, volumes, and image
.\dev.ps1 help Show all available commands

Running Docker commands manually

If you prefer raw Docker commands instead of dev.ps1:

Moving to a new machine

The Docker image pins PHP 8.3 and Composer 2.7. To upgrade PHP, change the FROM line in the Dockerfile.


All versions of tempmail with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
ext-curl Version *
ext-json Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package pyzit/tempmail contains the following files

Loading the files please wait ...