PHPackages                             enl/swiftmailer-extras - 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. enl/swiftmailer-extras

ActiveLibrary

enl/swiftmailer-extras
======================

Extra features for Swiftmailer - PHP mailing library

040PHP

Since Nov 27Pushed 9y ago1 watchersCompare

[ Source](https://github.com/enl/swiftmailer-extras)[ Packagist](https://packagist.org/packages/enl/swiftmailer-extras)[ RSS](/packages/enl-swiftmailer-extras/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Swiftmailer extras
==================

[](#swiftmailer-extras)

This library adds two facilities two [Swiftmailer library](http://swiftmailer.org):

- Adapter to PSR-3 compatible logger;
- Mailer class that can switch from messages spooling to realtime sending.

Logging
-------

[](#logging)

To use any kind of PSR-3 compatible logger with Swift you need to register plugin with logging adatper:

```
use Enl\Swiftmailer\Logger\PsrAdapter;

$logger = new Logger(); // Logger MUST implement \Psr\Log\LoggerInterface
$adapter = new PsrAdapter($logger);

$mailer = new Swift_Mailer();
$mailer->registerPlugin(new Swift_Plugins_LoggerPlugin($adapter));
```

Optional Spooling
-----------------

[](#optional-spooling)

As you know, to use Spool facility for `Swift_Mailer`, you need to define transport like this:

```
$transport = new Swift_Transport_SpoolTransport(new Swift_MemorySpool());
$mailer = new Swift_Mailer($transport);
```

It is absolutely OK until you need to send *this email right now*... To achieve this goal, I created a wrapper for swift mailer, which does the trick:

```
$realTransport = new Swift_Transport_NullTransport();
$spool = new Swift_MemorySpool();
$mailer = new Enl\Swifthmailer\Mailer($realTransport, $spool);
```

To send the message to a queue you should use mailer as usual:

```
$mailer->send(new Swift_Message());
```

To *immediately* send exactly one message you should use `immediately` function before sending:

```
$mailer->immediately()->send(new Swift_Message());
// Next message will be sent to a queue!
$mailer->send(new Swift_Message());
```

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/50587ee520f9c618e4663b3e62d04bace5458d30d8644c71a1e510ed94075e1a?d=identicon)[enl](/maintainers/enl)

---

Top Contributors

[![enl](https://avatars.githubusercontent.com/u/670322?v=4)](https://github.com/enl "enl (8 commits)")

### Embed Badge

![Health badge](/badges/enl-swiftmailer-extras/health.svg)

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

PHPackages © 2026

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