PHPackages                             postal/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. postal/postal

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

postal/postal
=============

Postal for PHP library.

v2.0.3(1y ago)81357.2k↓35.3%3413MITPHPPHP ^7.4 || ^8.0CI passing

Since May 8Pushed 8mo ago5 watchersCompare

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

READMEChangelog (6)Dependencies (4)Versions (7)Used By (13)

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.

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

[](#installation)

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

```
$ composer require postal/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

56

—

FairBetter than 97% of packages

Maintenance54

Moderate activity, may be stable

Popularity52

Moderate usage in the ecosystem

Community33

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 51.7% of commits — single point of failure

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

Every ~601 days

Recently: every ~321 days

Total

6

Last Release

378d ago

Major Versions

v1.0.1 → v2.0.02023-07-24

PHP version history (2 changes)v1.0PHP &gt;=5.4

v2.0.0PHP ^7.4 || ^8.0

### Community

Maintainers

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

![](https://avatars.githubusercontent.com/u/4765?v=4)[Adam Cooke](/maintainers/adamcooke)[@adamcooke](https://github.com/adamcooke)

---

Top Contributors

[![willpower232](https://avatars.githubusercontent.com/u/1619102?v=4)](https://github.com/willpower232 "willpower232 (15 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)")[![rolfdenhartog](https://avatars.githubusercontent.com/u/3692837?v=4)](https://github.com/rolfdenhartog "rolfdenhartog (1 commits)")[![stedaniels](https://avatars.githubusercontent.com/u/1185722?v=4)](https://github.com/stedaniels "stedaniels (1 commits)")

---

Tags

postalmail

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StyleECS

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.2k555.0M2.8k](/packages/aws-aws-sdk-php)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k832.6k54](/packages/neuron-core-neuron-ai)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3661.3M49](/packages/tencentcloud-tencentcloud-sdk-php)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

353.6k](/packages/eslazarev-wildberries-sdk)[tempest/framework

The PHP framework that gets out of your way.

2.3k37.6k21](/packages/tempest-framework)

PHPackages © 2026

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