Download the PHP package bounceshift/bounceshift-php without Composer

On this page you can find all versions of the php package bounceshift/bounceshift-php. 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 bounceshift-php

BounceShift PHP SDK

Framework-agnostic PHP client for the BounceShift email-validation API. Given an email address, BounceShift returns a status, a confidence score, and granular deliverability signals so you can protect your sender reputation before you hit send.

API reference: https://bounceshift.com/docs/api

Installation

The SDK relies on PSR-18 HTTP Client Discovery. Guzzle is included as a default implementation; any PSR-18 client works.

Quickstart

Both the API key and the organization ID are required — they are sent as the Authorization: Bearer and X-Organization-ID headers respectively.

Configuration

The result object

Client::validate() returns an immutable BounceShift\ValidationResult:

Property Type Description
email string The address that was validated.
status ValidationStatus The overall verdict (see below).
confidence int Confidence score, 0–100.
mxFound bool Whether MX records were found.
smtpValid ?bool SMTP probe result, or null if inconclusive.
isDisposable bool Disposable/temporary provider.
isCatchAll bool Domain accepts all mail.
isRoleAccount bool Role address (e.g. info@, support@).
fromCache bool Served from a cached prior result.
creditsUsed int Credits consumed by this call.
result array Freeform sub-status detail.
subStatus ?string Granular reason for the verdict (e.g. smtp_verified), or null.
recommendation ?Recommendation Actionable send recommendation, or null when absent or unrecognized.
recommendationValue ?string Raw recommendation string as sent by the API, preserved even when unrecognized.
qualityScore ?int Quality score, 0–100. Distinct from confidence; null when absent.
explanation ?string Plain-English sentence describing the verdict, or null.
didYouMean ?string Corrected address when the domain looks like a misspelling (gmial.comgmail.com), or null.

ValidationResult::isSafeToSend() returns true only when the status is valid or catch_all.

ValidationResult::isSendable() surfaces the API's actionable recommendation instead: it returns true only when recommendation is deliverable or send_with_caution. An absent, null, or unrecognized recommendation is treated as not sendable (and never throws).

Typo suggestions

didYouMean carries the corrected address when the domain is within a character or two of a major provider, and null otherwise. hasSuggestion() is the convenience check.

Two things to know:

Recommendations

BounceShift\Recommendation is a string-backed enum:

deliverable, send_with_caution, risky, undeliverable, unknown.

Statuses

BounceShift\ValidationStatus is a string-backed enum:

valid, invalid, risky, catch_all, unknown, disposable, spamtrap, abuse, do_not_mail.

Error handling

All exceptions extend BounceShift\Exceptions\BounceShiftException. API errors extend ApiException, which exposes $statusCode and $body.

Your API key is never included in exception messages or logs.

Fail open — never block your users

On a hot path such as validate-on-signup, a validation problem should never block the user. If your account runs out of credits, or the API is down, timing out, or unreachable, you almost always want to let the address through rather than crash the signup. Use validateSafe() — it never throws:

A degraded result has status unknown, creditsUsed = 0, and isDegraded() === true, so you can always tell "we couldn't check" apart from a genuine unknown verdict. Reach for validate() (which throws the typed exceptions above) only when you want to handle each failure yourself.

The timeout / connect_timeout options bound how long a stalled API can hold your request thread before validateSafe() returns a degraded result.

Testing

License

MIT. See LICENSE.


All versions of bounceshift-php with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
ext-json Version *
psr/http-client Version ^1.0
psr/http-factory Version ^1.0
php-http/discovery Version ^1.19
guzzlehttp/guzzle Version ^7.8
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 bounceshift/bounceshift-php contains the following files

Loading the files please wait ...