PHPackages                             magexon/postal - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Mail &amp; Notifications](/categories/mail)
4. /
5. magexon/postal

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

magexon/postal
==============

Postal for PHP library.

V2.0.3(9mo ago)03MITPHPPHP ~7.4.0 || ~8.0.0 || ~8.1.0||~8.2.0||~8.3.0||~8.4.0

Since Jul 27Pushed 9mo agoCompare

[ Source](https://github.com/magexon/postal-php)[ Packagist](https://packagist.org/packages/magexon/postal)[ Docs](https://github.com/atech/postal)[ RSS](/packages/magexon-postal/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (4)Versions (2)Used By (0)

Postal for PHP
==============

[](#postal-for-php)

This library helps you send e-mails through [Postal](https://github.com/postalserver/postal) in PHP 7.4 and above including PHP 8.4.

Installation
------------

[](#installation)

Install the library using [Composer](https://getcomposer.org/):

```
$ composer require magexon/postal

```

Usage
-----

[](#usage)

Sending an email is very simple. Just follow the example below. Before you can begin, you'll need to login to our web interface and generate a new API credential.

```
// Create a new Postal client using the server key you generate in the web interface
$client = new Postal\Client('https://postal.yourdomain.com', 'your-api-key');

// Create a new message
$message = new Postal\Send\Message();

// Add some recipients
$message->to('john@example.com');
$message->to('mary@example.com');
$message->cc('mike@example.com');
$message->bcc('secret@awesomeapp.com');

// Specify who the message should be from. This must be from a verified domain
// on your mail server.
$message->from('test@test.postal.io');

// Set the subject
$message->subject('Hi there!');

// Set the content for the e-mail
$message->plainBody('Hello world!');
$message->htmlBody('Hello world!');

// Add any custom headers
$message->header('X-PHP-Test', 'value');

// Attach any files
$message->attach('textmessage.txt', 'text/plain', 'Hello world!');

// Send the message and get the result
$result = $client->send->message($message);

// Loop through each of the recipients to get the message ID
foreach ($result->recipients() as $email => $message) {
    $email;          // The e-mail address of the recipient
    $message->id;    // The message ID
    $message->token; // The message's token
}
```

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance55

Moderate activity, may be stable

Popularity3

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

296d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ecdb621dd86bb9b893ac8ca176cd4c81177740f6397e987db9cd824e30f6cc2a?d=identicon)[magexon](/maintainers/magexon)

---

Top Contributors

[![willpower232](https://avatars.githubusercontent.com/u/1619102?v=4)](https://github.com/willpower232 "willpower232 (11 commits)")[![magexon](https://avatars.githubusercontent.com/u/89267831?v=4)](https://github.com/magexon "magexon (7 commits)")[![Josh-G](https://avatars.githubusercontent.com/u/487384?v=4)](https://github.com/Josh-G "Josh-G (6 commits)")[![adamcooke](https://avatars.githubusercontent.com/u/4765?v=4)](https://github.com/adamcooke "adamcooke (3 commits)")[![craigrileyuk](https://avatars.githubusercontent.com/u/68274157?v=4)](https://github.com/craigrileyuk "craigrileyuk (2 commits)")[![minusmillionaer](https://avatars.githubusercontent.com/u/3305960?v=4)](https://github.com/minusmillionaer "minusmillionaer (1 commits)")[![stedaniels](https://avatars.githubusercontent.com/u/1185722?v=4)](https://github.com/stedaniels "stedaniels (1 commits)")

---

Tags

emailemail-senderemailmarketingmagento2phppostalpostalmail

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StyleECS

Type Coverage Yes

### Embed Badge

![Health badge](/badges/magexon-postal/health.svg)

```
[![Health](https://phpackages.com/badges/magexon-postal/health.svg)](https://phpackages.com/packages/magexon-postal)
```

###  Alternatives

[coconutcraig/laravel-postmark

Laravel package for sending mail via the Postmark API

2152.9M1](/packages/coconutcraig-laravel-postmark)[postal/postal

Postal for PHP library.

81305.4k14](/packages/postal-postal)[thinkshout/mailchimp-api-php

PHP library for v3 of the MailChimp API

824.6M1](/packages/thinkshout-mailchimp-api-php)[vemcogroup/laravel-sparkpost-driver

SparkPost driver to use with Laravel 6.x|7.x|8.x|9.x|10.x

421.7M1](/packages/vemcogroup-laravel-sparkpost-driver)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
