Download the PHP package libresign/mailpit-client without Composer
On this page you can find all versions of the php package libresign/mailpit-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download libresign/mailpit-client
More information about libresign/mailpit-client
Files in libresign/mailpit-client
Package mailpit-client
Short Description Mailpit API Client for PHP - Modern replacement for Mailhog
License MIT
Informations about the package mailpit-client
Mailpit API Client for PHP 
A simple PHP (8.2+) client for Mailpit, the modern replacement for Mailhog.
Design Goals
- As little dependencies as possible (PHP-HTTP compliant via HTTPlug)
- Simple single client for Mailpit API
- Integration tests on all endpoints, both happy path and failure paths
Installation
This package does not require any specific HTTP client implementation, but is based on HTTPlug, so you can inject your own HTTP client of choice. So you when you install this library make sure you either already have an HTTP client installed, or install one at the same time as installing this library, otherwise installation will fail.
For more information please refer to the HTTPlug documentation for Library Users.
Usage
Where SomeHttpClient is a class that implements Http\Client\HttpClient from HTTPlug and SomeRequestFactory is a class that implements Http\Message\RequestFactory from HTTPlug, and my.mailpit.host is the hostname (or IP) where Mailpit is running, and port is the port where the Mailpit API is running (by default 1025).
Run tests
Make sure you have Mailpit running and run:
Running Mailpit for tests
You can either run your own instance of Mailpit or use the provided docker-compose file to run one for you. To run Mailpit with Docker make sure you have Docker installed and run:
Mailpit ports for tests
The tests expect Mailpit to listen to SMTP on port 2025 and to HTTP traffic on port 9025.
If you want different ports you can copy phpunit.xml.dist to phpunit.xml and change the port numbers in the environment variables therein.
All versions of mailpit-client with dependencies
ext-json Version *
ext-iconv Version *
php-http/httplug Version ^2.0
psr/http-message Version ^2.0
psr/http-factory Version ^1.0