PHPackages                             vchagin/yii2-swiftmailer - 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. vchagin/yii2-swiftmailer

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

vchagin/yii2-swiftmailer
========================

Fork of the SwiftMailer integration for the Yii framework for support PHP 8.2

047PHP

Since Jun 10Pushed 3y agoCompare

[ Source](https://github.com/vchagin/yii2-swiftmailer)[ Packagist](https://packagist.org/packages/vchagin/yii2-swiftmailer)[ RSS](/packages/vchagin-yii2-swiftmailer/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

 [ ![](https://camo.githubusercontent.com/b5d193f1ea460816c0ff23c02a58ec76f34df36801692158c4f39d757fa1cb3b/68747470733a2f2f73776966746d61696c65722e73796d666f6e792e636f6d2f696d616765732f6c6f676f2e706e67) ](https://swiftmailer.symfony.com/)

SwiftMailer Extension for Yii 2
===============================

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

This extension provides a [SwiftMailer](https://swiftmailer.symfony.com/) mail solution for [Yii framework 2.0](http://www.yiiframework.com).

For license information check the [LICENSE](LICENSE.md)-file.

[![Latest Stable Version](https://camo.githubusercontent.com/5fc8885b7b05ccc6c7935ff80525be508a9a5d68254d6dd036535ca68310b83f/68747470733a2f2f706f7365722e707567782e6f72672f796969736f66742f796969322d73776966746d61696c65722f762f737461626c652e706e67)](https://packagist.org/packages/yiisoft/yii2-swiftmailer)[![Total Downloads](https://camo.githubusercontent.com/c93b8ad658d5969bc24ee8d1fee7ba7dc6d9977741d401c6bf1b94bfdfab9dbd/68747470733a2f2f706f7365722e707567782e6f72672f796969736f66742f796969322d73776966746d61696c65722f646f776e6c6f6164732e706e67)](https://packagist.org/packages/yiisoft/yii2-swiftmailer)[![Build Status](https://github.com/yiisoft/yii2-swiftmailer/workflows/build/badge.svg)](https://github.com/yiisoft/yii2-swiftmailer/actions)

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

[](#installation)

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

Either run

```
php composer.phar require --prefer-dist yiisoft/yii2-swiftmailer

```

or add

```
"yiisoft/yii2-swiftmailer": "~2.1.0"
```

to the require section of your composer.json.

> Note: Version 2.1 of this extensions uses Swiftmailer 6, which requires PHP 7. If you are using PHP 5, you have to use version 2.0 of this extension, which uses Swiftmailer 5, which is compatible with PHP 5.4 and higher. Use the following version constraint in that case:
>
> ```
> "yiisoft/yii2-swiftmailer": "~2.0.0"
> ```

Usage
-----

[](#usage)

To use this extension, simply add the following code in your application configuration:

```
return [
    //....
    'components' => [
        'mailer' => [
            'class' => 'yii\swiftmailer\Mailer',
        ],
    ],
];
```

You can then send an email as follows:

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

For further instructions refer to the [related section in the Yii Definitive Guide](http://www.yiiframework.com/doc-2.0/guide-tutorial-mailing.html).

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity22

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/b32fe7b2f2f5e2d3e515668342c00c71d77933b1762b54a2997e04d42410af9d?d=identicon)[Vladimir Chagin](/maintainers/Vladimir%20Chagin)

---

Top Contributors

[![qiangxue](https://avatars.githubusercontent.com/u/993322?v=4)](https://github.com/qiangxue "qiangxue (1903 commits)")[![cebe](https://avatars.githubusercontent.com/u/189796?v=4)](https://github.com/cebe "cebe (737 commits)")[![samdark](https://avatars.githubusercontent.com/u/47294?v=4)](https://github.com/samdark "samdark (634 commits)")[![klimov-paul](https://avatars.githubusercontent.com/u/1482054?v=4)](https://github.com/klimov-paul "klimov-paul (357 commits)")[![creocoder](https://avatars.githubusercontent.com/u/896494?v=4)](https://github.com/creocoder "creocoder (148 commits)")[![resurtm](https://avatars.githubusercontent.com/u/100198?v=4)](https://github.com/resurtm "resurtm (123 commits)")[![Ragazzo](https://avatars.githubusercontent.com/u/1748844?v=4)](https://github.com/Ragazzo "Ragazzo (75 commits)")[![lucianobaraglia](https://avatars.githubusercontent.com/u/374554?v=4)](https://github.com/lucianobaraglia "lucianobaraglia (44 commits)")[![suralc](https://avatars.githubusercontent.com/u/730039?v=4)](https://github.com/suralc "suralc (42 commits)")[![pmoust](https://avatars.githubusercontent.com/u/2493339?v=4)](https://github.com/pmoust "pmoust (36 commits)")[![schmunk42](https://avatars.githubusercontent.com/u/649031?v=4)](https://github.com/schmunk42 "schmunk42 (26 commits)")[![slavcodev](https://avatars.githubusercontent.com/u/757721?v=4)](https://github.com/slavcodev "slavcodev (20 commits)")[![LarryUllman](https://avatars.githubusercontent.com/u/1674823?v=4)](https://github.com/LarryUllman "LarryUllman (18 commits)")[![kartik-v](https://avatars.githubusercontent.com/u/3592619?v=4)](https://github.com/kartik-v "kartik-v (16 commits)")[![tarasio](https://avatars.githubusercontent.com/u/1010578?v=4)](https://github.com/tarasio "tarasio (12 commits)")[![crtlib](https://avatars.githubusercontent.com/u/4428231?v=4)](https://github.com/crtlib "crtlib (12 commits)")[![bwoester](https://avatars.githubusercontent.com/u/309565?v=4)](https://github.com/bwoester "bwoester (12 commits)")[![gevik](https://avatars.githubusercontent.com/u/434535?v=4)](https://github.com/gevik "gevik (10 commits)")[![gonimar](https://avatars.githubusercontent.com/u/756571?v=4)](https://github.com/gonimar "gonimar (9 commits)")[![sensorario](https://avatars.githubusercontent.com/u/820248?v=4)](https://github.com/sensorario "sensorario (9 commits)")

### Embed Badge

![Health badge](/badges/vchagin-yii2-swiftmailer/health.svg)

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

###  Alternatives

[maize-tech/laravel-email-domain-rule

Laravel Email Domain Rule

612.0k](/packages/maize-tech-laravel-email-domain-rule)[sarfraznawaz2005/noty

Laravel package to incorporate noty flash notifications into laravel.

324.5k](/packages/sarfraznawaz2005-noty)

PHPackages © 2026

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