PHPackages                             netglue/laminas-postmark-transport - 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. netglue/laminas-postmark-transport

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

netglue/laminas-postmark-transport
==================================

Mail transport using Postmark's API for applications using laminas components for email

1.4.0(2y ago)020.5k[1 issues](https://github.com/netglue/laminas-postmark-transport/issues)MITPHPPHP ~8.1 || ~8.2 || ~8.3

Since Mar 20Pushed 1y ago1 watchersCompare

[ Source](https://github.com/netglue/laminas-postmark-transport)[ Packagist](https://packagist.org/packages/netglue/laminas-postmark-transport)[ RSS](/packages/netglue-laminas-postmark-transport/feed)WikiDiscussions 1.5.x Synced 1w ago

READMEChangelog (10)Dependencies (16)Versions (29)Used By (0)

Postmark Mail Transport for Laminas
===================================

[](#postmark-mail-transport-for-laminas)

[![PHPUnit Test Suite](https://github.com/netglue/laminas-postmark-transport/workflows/Continuous%20Integration/badge.svg)](https://github.com/netglue/laminas-postmark-transport/workflows/Continuous%20Integration/badge.svg)[![Type Coverage](https://camo.githubusercontent.com/3a5395a8afc006c767b8cd8a7e6a65eb4b38cefba1d4885d68bf1ff494b26f8c/68747470733a2f2f73686570686572642e6465762f6769746875622f6e6574676c75652f6c616d696e61732d706f73746d61726b2d7472616e73706f72742f636f7665726167652e737667)](https://shepherd.dev/github/netglue/laminas-postmark-transport)

Caution

This library is now abandoned because `laminas-mail` is abandoned

Introduction
------------

[](#introduction)

This lib provides a mail transport for use with [Laminas\\Mail](https://github.com/laminas/laminas-mail) and [Postmark’s transactional email service](https://postmarkapp.com). It also provides email message validators to help make sure that messages you send via Postmark are acceptable - I'm quite pleased with the validator that checks the from address is listed in the verified postmark domains on your account, or amongst the [configured sender signatures](https://postmarkapp.com/manual#step-2-set-up-the-address-you-plan-to-send-from).

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

[](#installation)

```
composer require netglue/laminas-postmark-transport
```

If you are using this in an app built with Expressive/Mezzio then the config provider should get injected automatically for you during installation by way of the [Laminas component installer](https://docs.laminas.dev/laminas-component-installer/). If you're using Laminas MVC then you might have to take extra steps to get the default config fired up.

One of the dependencies is a tiny package [netglue/psr-container-postmark](https://github.com/netglue/psr-container-postmark) - this is what's used to configure the official Postmark API client so you can find some additional info in the README in that lib for configuring your account and server tokens for the service.

Usage
-----

[](#usage)

By default, assuming use of Laminas Service Manager for your DIC, you will be able to retrieve your transport using either:

```
$transport = $container->get(\Laminas\Mail\Transport\TransportInterface::class);
// or
$transport = $container->get(\Netglue\Mail\Postmark\Transport\PostmarkTransport::class);
```

As with all mail transports, you'll only interact with it to send a `Laminas\Mail\Message`:

```
$message = new Message();
// ... Set To, From, Subject etc...
$transport->send($message);
```

Read up on the docs specific to [sending mail with Laminas components here](https://docs.laminas.dev/laminas-mail/)...

The main reason that I put this lib together is so that I could validate messages *before* dispatching them to the API to surface common errors such as an invalid sender address, too many recipients etc. The transport accepts a validator in its constructor arguments that is used to enforce the constraints placed on sending mail with Postmark specifically.

There is a default validator chain that you can inspect covering most of these constraints and a shipped FromAddressValidator that is not used by default. The reason this one isn't initially enabled is because it makes API calls to the account endpoints to retrieve the configured sending domains and email addresses and then checks that the From header of the message is amongst the verified senders.

So, to use this validator, you'd need to:

- Configure the access token for the account API
- Inject a different validator chain into the transport
- Provide the name of a PSR-6 compatible cache that can be retrieved from the container

Hopefully the following configuration should illuminate what's required...

```
'postmark' => [
    'server_token' => 'Your "server" token for sending mail',
    'account_token' => 'Token for the account API', // Required when using the sender validator
    'message_validator' => \MyApp\Validator\CustomMessageValidationChain::class,
    'cache_service' => \MyApp\PsrCacheItemPool::class, // The cache to use for the domain and sender signatures list.
],
```

Finally, this lib also has a dependency on [netglue/laminas-mail-utils](https://github.com/netglue/laminas-mail-utils) which is primarily a collection of more generic validators for mail messages and message behaviours that are intended for use with other vendors such as SparkPost, MailGun etc. If/when you build your custom validator chain, there are a bunch of validators there that might be useful.

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance32

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity82

Battle-tested with a long release history

 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

Every ~84 days

Recently: every ~162 days

Total

22

Last Release

474d ago

Major Versions

0.8.x-dev → 1.0.02022-08-29

PHP version history (7 changes)0.0.0PHP &gt;=7.3

0.5.0PHP ^7.3 || ~8.0

0.6.0PHP ^7.3 || ~8.0 || ~8.1

0.7.0PHP ^7.4 || ~8.0 || ~8.1

1.1.0PHP ~8.0 || ~8.1 || ~8.2

1.3.0PHP ~8.1 || ~8.2

1.4.0PHP ~8.1 || ~8.2 || ~8.3

### Community

Maintainers

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

---

Top Contributors

[![renovate[bot]](https://avatars.githubusercontent.com/in/2740?v=4)](https://github.com/renovate[bot] "renovate[bot] (223 commits)")[![gsteel](https://avatars.githubusercontent.com/u/2803720?v=4)](https://github.com/gsteel "gsteel (99 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (80 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (76 commits)")

---

Tags

emaillaminaslaminas-componentslaminas-mailmezziopostmarkpostmark-integrations

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/netglue-laminas-postmark-transport/health.svg)

```
[![Health](https://phpackages.com/badges/netglue-laminas-postmark-transport/health.svg)](https://phpackages.com/packages/netglue-laminas-postmark-transport)
```

###  Alternatives

[slm/mail

Integration of various email service providers in the Laminas\\Mail

108732.4k1](/packages/slm-mail)[elgg/elgg

Elgg is an award-winning social networking engine, delivering the building blocks that enable businesses, schools, universities and associations to create their own fully-featured social networks and applications.

1.7k15.7k5](/packages/elgg-elgg)[paragonie/gpg-mailer

Encrypt outbound emails with Crypt\_GPG

9524.2k1](/packages/paragonie-gpg-mailer)[dyninc/dyn-php

Dyn PHP SDK - for interaction with Dyn's product APIs

22111.3k3](/packages/dyninc-dyn-php)

PHPackages © 2026

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