codiblenet / mail-reacher-php
Official PHP SDK for the Mail Reacher API.
Requires
- php: ^8.1
- psr/http-client: ^1.0
- psr/http-factory: ^1.0
- psr/http-message: ^1.1 || ^2.0
Requires (Dev)
- guzzlehttp/guzzle: ^7.8
- guzzlehttp/psr7: ^2.6
- phpunit/phpunit: ^10.5 || ^11.0
This package is auto-updated.
Last update: 2026-06-14 21:07:12 UTC
README
Official PHP SDK for the Mail Reacher API. It lets plain PHP, Symfony, Laravel jobs, workers and command-line scripts send transactional email through a Mail Reacher environment key.
Installation
composer require codiblenet/mail-reacher-php
Usage
use MailReacher\Client; use MailReacher\EmailAddress; $client = new Client(apiKey: $_ENV['MAILREACHER_API_KEY']); $response = $client->emails()->send([ 'to' => new EmailAddress('marie@example.com', 'Marie'), 'from' => new EmailAddress('noreply@your-domain.com', 'Your App'), 'subject' => 'Bienvenue', 'html' => '<p>Bonjour Marie</p>', 'text' => 'Bonjour Marie', 'metadata' => ['source' => 'app'], ]);
MAILREACHER_API_KEY is the only required Mail Reacher environment variable. Test keys simulate delivery in Mail Reacher; live keys send through the provider configured for the environment.
Laravel
For Laravel applications that already use Mail, Mailable or notifications, use the transport package instead:
composer require codiblenet/laravel-mail-reacher
Publishing
This repository is intended to be published on Packagist as codiblenet/mail-reacher-php and versioned with GitHub releases/tags such as v0.1.0.
Testing
composer test