Search by

myth / postal

lonnieezell

A modern CodeIgniter 4 email replacement library.

Package info

github.com/lonnieezell/postal

pkg:composer/myth/postal

Fund package maintenance!

lonnieezell

Statistics

Installs: 914

Dependents: 2

Suggesters: 0

Stars: 4

Open Issues: 3

v1.0.0 2026-10-31 21:12 UTC

README

PHPUnit PHPStan Latest Version License

A modern email library for CodeIgniter 4.

Write a message once and send it through SMTP, Amazon SES, Resend, sendmail or a failover chain. You choose the provider in config, not code. Mailables, Markdown emails, DKIM signing, suppression lists and test fakes are built in, and existing service('email') calls keep working, so you can adopt Postal one step at a time.

Status: stable. Postal follows semantic versioning: breaking changes only arrive in a new major version and are called out in the changelog.

📖 Documentation

lonnieezell.github.io/postal

Installation

Requires PHP 8.2+ and CodeIgniter 4.7+.

composer require myth/postal

Quick look

<?php

use Myth\Postal\Email;

$email = (new Email())
    ->from('hello@example.com', 'Acme')
    ->to('user@example.com')
    ->subject('Welcome aboard')
    ->html('<p>Glad to have you with us.</p>');

$result = service('mailer')->send($email);

if (! $result->success) {
    log_message('error', 'Welcome email failed: ' . $result->error);
}

Out of the box the default mailer discards every message, so nothing is sent by accident. The Quick Start sets up a real one.

Contributing

Contributions are welcome. Run composer ci (style, static analysis and tests) before opening a pull request, and cover new behavior with tests. Every Composer script has a Docker equivalent prefixed with docker:, such as composer docker:ci.

Support Postal

Postal is free and open source, built and maintained by Lonnie Ezell. If it saves you time, please consider sponsoring its development on GitHub. Sponsorship helps fund new features, fixes and the documentation.

License

Released under the MIT License.