Skip to content
UseMailxPublic

About

Official PHP SDK for MailX

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mailx/sdk (PHP)

Official PHP SDK for MailX.

composer require mailx/sdk

Usage

use MailX\Client;

$client = new Client('your_api_key');

$email = $client->sendEmail([
    'from' => 'you@yourdomain.com',
    'to' => ['recipient@example.com'],
    'subject' => 'Hello from MailX',
    'html' => '<p>Hello!</p>',
]);

echo $email['id'];

Retries

Requests that fail with 429 or 5xx are retried automatically (default: 3 attempts), honoring the Retry-After header when present, otherwise exponential backoff with jitter.

Errors

Failed requests throw MailX\MailXException with status, type, apiCode, requestId, and retryAfter properties.

Coverage

sendEmail/sendBatch/getEmail/listEmails accept/return plain associative arrays mirroring the OpenAPI schema field names exactly. All other resources (domains, DKIM/SPF/DMARC/BIMI, templates, contacts, audiences, broadcasts, analytics, suppressions, webhooks) are covered with one method per operation, same array-in/array-out shape — see your server's GET /openapi.json for exact fields.

Testing

composer install
vendor/bin/phpunit tests

Live contract tests are skipped unless MAILX_SDK_TEST_BASE_URL and MAILX_SDK_TEST_API_KEY are set.

About

Official PHP SDK for MailX

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages