A simple and beginner‑friendly PHP client for the MimePost API.
It wraps a subset of the endpoints defined in the provided Postman collection and can be easily extended.
Use Composer:
composer require mimepost/mimepost-php
If you are not using Composer, include the src/Client.php
file manually.
<?php
require 'vendor/autoload.php';
$client = new MimePost\Client('YOUR_API_TOKEN');
// Send an email using a template
// Send an email using a template
$response = $client->sendEmail([
'template_uid' => 'welcome_email_test',
'subject' => 'Test Mail using MimePost Client',
'from_name' => 'Your Sender Name',
'from_email' => '[email protected]',
'to' => [ ['email' => '[email protected]'] ],
]);
print_r($response);
/*
//example output
Array
(
[success] => 1
[error_code] => 0
[message] => Mails accepted
[queue_ids] => Array
(
[[email protected]] => Array
(
[status] => f8dcecc8-6728-4ead-8def-c463fd1b9620
)
)
)
*/
Additional helpers:
$templates = $client->listTemplates();
$domainList = $client->listDomains();
$stats = $client->getStats(['start_date' => '20250101', 'end_date' => '20250131']);
The Client::request()
method is public. You can call any MimePost endpoint:
$result = $client->request('GET', 'webhooks');
MIT