mimepost / mimepost-php
Simple PHP SDK for MimePost API
v1.0.0
2025-09-10 15:37 UTC
Requires
- php: >=7.4
- ext-json: *
README
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.
Installation
Use Composer:
composer require mimepost/mimepost-php
If you are not using Composer, include the src/Client.php file manually.
Usage
Send Email
<?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' => 'yoursender@example.com', 'to' => [ ['email' => 'to@example.com'] ], ]); print_r($response);
example output
/*
//example output
Array
(
[success] => 1
[error_code] => 0
[message] => Mails accepted
[queue_ids] => Array
(
[to@example.com] => Array
(
[status] => f8dcecc8-6728-4ead-8def-c463fd1b9620
)
)
)
*/
Additional helpers:
$templates = $client->listTemplates(); $domainList = $client->listDomains(); $stats = $client->getStats(['start_date' => '20250101', 'end_date' => '20250131']);
Extending
The Client::request() method is public. You can call any MimePost endpoint:
$result = $client->request('GET', 'webhooks');
License
MIT