Download the PHP package eustasy/browning without Composer
On this page you can find all versions of the php package eustasy/browning. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package browning
Browning: A Mailgun Script (v1.31)
Browning is a tiny PHP library to send emails with Mailgun, that uses CURL instead of Mailgun's (slightly porky) library. Requires PHP 8.1+ and the cURL extension.
Installation
Then include the Composer autoloader:
This makes the Eustasy\Browning\Mailer and Eustasy\Browning\Recaptcha classes available.
1. Setup with Mailgun
The cURL extension is required. On Debian/Ubuntu:
Sign up for Mailgun — the free tier covers 100 emails per day. See pricing for the paid tiers.
Copy the bundled config template out of vendor/, for example to config/browning.php:
Open your copy and fill in your details — it's a PHP file that returns a config array (loaded with require in step 2):
Add config/browning.php to your .gitignore to avoid committing credentials.
2. Sending email
Build a Mailer from your config and call send():
send() returns a Eustasy\Browning\Result:
| Property | Type | Description |
|---|---|---|
success |
bool |
true if the email was accepted by Mailgun. |
error |
string\|null |
Error message, or null on success. |
By default error is a friendly, user-safe message. Pass debug: true to get technical detail instead:
Prefer explicit wiring? Construct it directly. The constructor also accepts a custom Transport as its fifth argument —
that's how the tests avoid the network:
3. Setup with reCAPTCHA
To protect a form with Google reCAPTCHA v2, add your keys under Recaptcha in the config —
SiteKey for the form, SecretKey for verification.
Keys come from the Google reCAPTCHA admin console.
4. CAPTCHA form
Add the widget to your HTML form, using your site key:
5. CAPTCHA validation
Verify the response server-side before sending:
verify() returns a Eustasy\Browning\RecaptchaResult with success (bool), errorCodes (string[]), and error (string|null).
All versions of browning with dependencies
ext-curl Version *