mailvoidr / laravel
Official Laravel SDK for the Mailvoidr transactional email API
v0.1.4
2026-06-29 15:30 UTC
Requires
- php: ^8.2
- illuminate/http: ^10.0|^11.0|^12.0|^13.0
- illuminate/mail: ^10.0|^11.0|^12.0|^13.0
- illuminate/support: ^10.0|^11.0|^12.0|^13.0
README
Official Laravel client for the Mailvoidr transactional email API.
Use this when SMTP port 587 is unavailable — the HTTP API delivers the same way.
Install
composer require mailvoidr/laravel
Configure
Only your API key is required. Base URL, default sender (hello@mailvoidr.com), and timeout are built in.
MAIL_MAILER=mailvoidr MAILVOIDR_API_KEY=mvdr_live_your_key_here
Add a mailer in config/mail.php:
'mailvoidr' => [ 'transport' => 'mailvoidr', ],
That's it — Mail::, Mailables, and Notifications all route through Mailvoidr.
Laravel Mail (recommended)
use Illuminate\Support\Facades\Mail; use App\Mail\WelcomeMail; Mail::to('riya@example.com')->send(new WelcomeMail());
// Notification $user->notify(new OrderShipped($order));
Default sender is hello@mailvoidr.com. Override per mailable:
return $this->from('hello@mail.yourdomain.com', 'Acme') ->subject('Welcome') ->view('emails.welcome');
Direct API client
use Mailvoidr\Laravel\Facades\Mailvoidr; $response = Mailvoidr::send([ 'to' => ['riya@example.com'], 'subject' => 'Welcome to Acme', 'html' => '<h1>Hey Riya</h1>', ]); $send = Mailvoidr::getSend($response->id);
Inject the client:
use Mailvoidr\Laravel\Client\MailvoidrClient; public function __construct(private MailvoidrClient $mailvoidr) {}
Errors
MailvoidrException is thrown on 402 (plan limit), 403 (live sending off), 422 (validation), and other non-success responses. The mail transport wraps these as TransportException.