PHPackages                             izumi-kun/yii2-spoolmailer - 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. izumi-kun/yii2-spoolmailer

ActiveYii2-extension[Mail &amp; Notifications](/categories/mail)

izumi-kun/yii2-spoolmailer
==========================

Implements email queue using SwiftMailer spool transport and yii2-swiftmailer extension

0.5.0(8y ago)44.2k1BSD-3-ClausePHPPHP &gt;=7.0.0

Since Mar 18Pushed 7y ago2 watchersCompare

[ Source](https://github.com/Izumi-kun/yii2-spoolmailer)[ Packagist](https://packagist.org/packages/izumi-kun/yii2-spoolmailer)[ RSS](/packages/izumi-kun-yii2-spoolmailer/feed)WikiDiscussions master Synced yesterday

READMEChangelog (7)Dependencies (5)Versions (9)Used By (0)

SwiftMailer Extension for Yii 2 with Spooling
=============================================

[](#swiftmailer-extension-for-yii-2-with-spooling)

Implements email queue using [SwiftMailer](http://swiftmailer.org/) spool transport and [yii2-swiftmailer](https://github.com/yiisoft/yii2-swiftmailer) extension.

It supported queues based on built-in SwiftMailer spools or [Yii2 Queue Extension](https://github.com/yiisoft/yii2-queue).

[![Latest Stable Version](https://camo.githubusercontent.com/d57da1c281adc031ea6a2ac41ede8e61af8517d430e28f453ebd92f090e1b5b8/68747470733a2f2f706f7365722e707567782e6f72672f697a756d692d6b756e2f796969322d73706f6f6c6d61696c65722f762f737461626c65)](https://packagist.org/packages/izumi-kun/yii2-spoolmailer)[![Total Downloads](https://camo.githubusercontent.com/d0b0f6636eb2a85b8857e4f3c3a3a3d0c4071113e7ef6092718c5480022b8054/68747470733a2f2f706f7365722e707567782e6f72672f697a756d692d6b756e2f796969322d73706f6f6c6d61696c65722f646f776e6c6f616473)](https://packagist.org/packages/izumi-kun/yii2-spoolmailer)[![Build Status](https://camo.githubusercontent.com/207dc2ae1d65605b9685fd0b8b379b83d87f52050f9dfb871645328c6eec764e/68747470733a2f2f7472617669732d63692e6f72672f497a756d692d6b756e2f796969322d73706f6f6c6d61696c65722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Izumi-kun/yii2-spoolmailer)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/4d310400ec6aba2bc67bc6a7b826f17e7f0b8adc2cd78e8f29a243ee595233e4/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f497a756d692d6b756e2f796969322d73706f6f6c6d61696c65722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/Izumi-kun/yii2-spoolmailer/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/e6ee733d261daae6d644347dfee25c0fc4ed2a9ad484bb0ad571c5a0f663b57e/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f497a756d692d6b756e2f796969322d73706f6f6c6d61696c65722f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/Izumi-kun/yii2-spoolmailer/?branch=master)

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

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist izumi-kun/yii2-spoolmailer

```

or add

```
"izumi-kun/yii2-spoolmailer": "~1.0.0"

```

to the require section of your composer.json.

Basic Usage
-----------

[](#basic-usage)

This way uses built-in SwiftMailer spools: **FileSpool** (default) or **MemorySpool**.

Add the following code in your application configuration (both web and console):

```
return [
    //....
    'components' => [
        //....
        'mailer' => [
            'class' => izumi\spoolmailer\Mailer::class,
        ],
    ],
];
```

Add the following code in your console configuration:

```
return [
    //....
    'controllerMap' => [
        'mail' => izumi\spoolmailer\MailController::class,
    ],
];
```

You can then add an email in queue as follows:

```
Yii::$app->mailer->compose('contact/html')
     ->setFrom('from@domain.com')
     ->setTo($form->email)
     ->setSubject($form->subject)
     ->queue();
```

Process email queue by follow console command:

```
./yii mail/flush

```

CRON job:

```
* * * * * php /var/www/yii-app/yii mail/flush >/dev/null 2>&1

```

Advanced Usage
--------------

[](#advanced-usage)

This way requires [Yii2 Queue Extension](https://github.com/yiisoft/yii2-queue) in your application.

Add the following code in your application configuration (both web and console):

```
return [
    //....
    'components' => [
        //....
        'mailer' => [
            'class' => izumi\spoolmailer\Mailer::class,
            'spoolMailer' => [
                'class' => izumi\spoolmailer\spools\QueueSpool::class,
                'queue' => 'queue', // the application component ID of the queue object
            ],
        ],
    ],
];
```

For more details see the [Yii2 Queue Guide](https://github.com/yiisoft/yii2-queue/blob/master/docs/guide/README.md).

License
-------

[](#license)

BSD-3-Clause

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity53

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.

###  Release Activity

Cadence

Every ~43 days

Recently: every ~64 days

Total

7

Last Release

3138d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1062584?v=4)[Viktor Khokhryakov](/maintainers/Izumi-kun)[@Izumi-kun](https://github.com/Izumi-kun)

---

Top Contributors

[![Izumi-kun](https://avatars.githubusercontent.com/u/1062584?v=4)](https://github.com/Izumi-kun "Izumi-kun (38 commits)")

---

Tags

emailmailerqueueswiftmailerswiftmailer-spoolyii2emailqueueyii2extensionswiftmaileryii2-swiftmailerspooling

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/izumi-kun-yii2-spoolmailer/health.svg)

```
[![Health](https://phpackages.com/badges/izumi-kun-yii2-spoolmailer/health.svg)](https://phpackages.com/packages/izumi-kun-yii2-spoolmailer)
```

###  Alternatives

[nterms/yii2-mailqueue

Email queue component for yii2 that works with yii2-swiftmailer.

84135.6k2](/packages/nterms-yii2-mailqueue)[tigrov/yii2-mailqueue

Yii2 mail queue component for yii2-swiftmailer.

196.6k](/packages/tigrov-yii2-mailqueue)[nickcv/yii2-mandrill

Mandrill Api Integration for Yii2

29576.8k2](/packages/nickcv-yii2-mandrill)[boundstate/yii2-mailgun

Mailgun integration for the Yii framework

28168.1k](/packages/boundstate-yii2-mailgun)[rmrevin/yii2-postman

Mail module for Yii2.

2912.3k](/packages/rmrevin-yii2-postman)[djagya/yii2-sparkpost

A library provides Yii2 integration with SparkPost mail service

1916.4k](/packages/djagya-yii2-sparkpost)

PHPackages © 2026

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