php-extended / php-api-net-fakemail-object
A library that implements the php-extended/php-api-net-fakemail-interface library
7.0.6
2024-07-31 14:08 UTC
Requires
Requires (Dev)
This package is auto-updated.
Last update: 2024-10-01 00:16:50 UTC
README
A php API wrapper to connect to fakemail.net API
Installation
The installation of this library is made via composer and the autoloading of all classes of this library is made through their autoloader.
- Download
composer.phar
from their website. - Then run the following command to install this library as dependency :
php composer.phar php-extended/php-api-net-fakemail-object ^7
Basic Usage
For the basic functions, use :
use PhpExtended\FakeMailNetApi\FakeMailNetApiEndpoint;
use PhpExtended\Endpoint\HttpEndpoint;
/* @var $client \Psr\Http\Client\ClientInterface */
$endpoint = new FakeMailNetApiEndpoint(new HttpEndpoint($client));
$emailAddress = $endpoint->provideNewEmail();
$metadata = $endpoint->getEmailMetadatas($emailAddress, 1); // returns an PagedIterator of FakeMailNetApiEmailMetadata
$endpoint->getEmail($metadata); // returns a \Psr\Http\Message\ResponseInterface
License
MIT (See license file).