sendfeather / laravel
Laravel mail transport and API client for Sendfeather.
Requires
- php: ^8.3
- illuminate/http: ^12.0|^13.0
- illuminate/mail: ^12.0|^13.0
- illuminate/support: ^12.0|^13.0
README
Laravel mail transport and API client for Sendfeather.
Do you need this?
Often not. Laravel's built-in smtp mailer works against the Sendfeather SMTP
gateway with no package, no dependency, and nothing to keep up to date.
Reach for this driver when you want the HTTP API instead:
- One HTTPS round trip rather than an SMTP connection,
EHLO,AUTH,MAIL FROM,RCPT TO,DATA,QUIT— noticeable when a send blocks a web request. - Works where outbound 587/465/2525 is blocked, which is most PaaS hosts.
- Returns the Sendfeather message id synchronously, so a record can link straight to its delivery timeline.
- Structured errors for throttling, suppressed recipients, and unverified domains, instead of SMTP status codes the framework swallows.
Installation
composer require sendfeather/laravel
Requires PHP 8.3+ and Laravel 12 or 13. The service provider and the
Sendfeather facade are registered automatically by package discovery.
Publishing the config file is optional — the defaults read from the environment:
php artisan vendor:publish --tag=sendfeather-config
Configuration
Add the Sendfeather mailer to config/mail.php:
'sendfeather' => [ 'transport' => 'sendfeather', ],
Create an API key in the Sendfeather dashboard under API Keys — it looks
like ulk_live_… — and configure your environment:
MAIL_MAILER=sendfeather MAIL_FROM_ADDRESS=receipts@mail.sendfeather.com MAIL_FROM_NAME="Sendfeather" SENDFEATHER_ENDPOINT=https://sendfeather.com SENDFEATHER_API_KEY=ulk_live_your_api_key SENDFEATHER_TIMEOUT=15
Clear cached configuration after changing mail settings:
php artisan config:clear
Usage
Use Laravel mail as usual:
use Illuminate\Support\Facades\Mail; Mail::raw('Hello from Laravel through Sendfeather.', function ($message) { $message ->to('person@example.com') ->subject('Sendfeather test'); });
Or call the Sendfeather API client directly:
use Sendfeather\Laravel\Facades\Sendfeather; $response = Sendfeather::emails()->send([ 'from' => 'Sendfeather <receipts@mail.sendfeather.com>', 'to' => ['person@example.com'], 'subject' => 'Direct Sendfeather API test', 'text' => 'Hello from Sendfeather.', ]);
The response carries the message id, so you can store it against your own record and look the delivery up later:
$id = $response['id']; // email_... $email = Sendfeather::emails()->get($id)['data']; $email['status']; // queued, sent, delivered, bounced, ... $email['events']; // the delivery timeline
Failed requests throw Illuminate\Http\Client\RequestException, which carries
the API's structured error — throttling, a suppressed recipient, an unverified
sending domain — rather than the status code an SMTP transport would surface.
License
The Sendfeather Laravel package is open-sourced software licensed under the MIT license.