mimepost/mimepost-php

Simple PHP SDK for MimePost API

Maintainers

Package info

github.com/mimepost/mimepost-php

pkg:composer/mimepost/mimepost-php

Statistics

Installs: 4

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.0 2025-09-10 15:37 UTC

This package is auto-updated.

Last update: 2026-03-10 17:04:56 UTC


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