Skip to content

mimepost/mimepost-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MimePost Simple PHP Client

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'   => '[email protected]',
    'to'           => [ ['email' => '[email protected]'] ],
]);

print_r($response);

example output

/*
//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']);

Extending

The Client::request() method is public. You can call any MimePost endpoint:

$result = $client->request('GET', 'webhooks');

License

MIT

About

MimePost PHP Client

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages