PHPackages                             frank/symfonymailer-for-yii2 - 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. frank/symfonymailer-for-yii2

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

frank/symfonymailer-for-yii2
============================

Symfonymailer for Yii2

0136PHP

Since Aug 15Pushed 3y agoCompare

[ Source](https://github.com/frank1fr/yii2-symfonymailer)[ Packagist](https://packagist.org/packages/frank/symfonymailer-for-yii2)[ RSS](/packages/frank-symfonymailer-for-yii2/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

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

[](#installation)

Version: 1.0.1

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

Either run:

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

```

or add:

```
"frank1fr/yii2-symfonymailer": "~1.0.0"
```

to the require section of your composer.json.

Usage
-----

[](#usage)

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

```
return [
    //....
    'components' => [
        'mailer' => [
            'class' => \yii\symfonymailer\Mailer::class,
            'transport' => [
                'scheme' => 'smtps',
                'host' => '',
                'username' => '',
                'password' => '',
                'port' => 465,
                'dsn' => 'native://default',
            ],
            'viewPath' => '@common/mail',
            // send all mails to a file by default. You have to set
			// 'useFileTransport' to false and configure transport
			// for the mailer to send real emails.
			'useFileTransport' => false,
        ],
    ],
];
```

or

```
return [
    //....
    'components' => [
        'mailer' => [
            'class' => \yii\symfonymailer\Mailer::class,
            'transport' => [
                'dsn' => 'smtp://user:pass@smtp.example.com:25',
            ],
        ],
    ],
];
```

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();
```

Migrating from yiisoft/yii2-swiftmailer
---------------------------------------

[](#migrating-from-yiisoftyii2-swiftmailer)

Follow these steps to migrate from the deprecated [yiisoft/yii2-swiftmailer](https://github.com/yiisoft/yii2-swiftmailer) to this extension:

1. Swiftmailer default transport was the `SendmailTransport`, while this extension will default to a `NullTransport` (sends no mail). You can use the swiftmailer default by defining in application config:

    ```
    'mailer' => [
        'class' => yii\symfonymailer\Mailer::class,
        'transport' => [
            'dsn' => 'sendmail://default',
        ],
    ],
    ```
2. Codeceptions TestMailer specifies `swiftmailer\Message` as a default class in . This can also be changed by defining in test config:

    ```
    'mailer' => [
        'class' => yii\symfonymailer\Mailer::class,
        'messageClass' => \yii\symfonymailer\Message::class,
    ],
    ```

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity25

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/dc43c48cf639928045e1cd8752ba626a8919ddacefe5d5a99e8c41df275c4666?d=identicon)[frank1fr](/maintainers/frank1fr)

---

Top Contributors

[![Krakozaber](https://avatars.githubusercontent.com/u/2918147?v=4)](https://github.com/Krakozaber "Krakozaber (12 commits)")[![samdark](https://avatars.githubusercontent.com/u/47294?v=4)](https://github.com/samdark "samdark (12 commits)")[![frankflynter](https://avatars.githubusercontent.com/u/116003543?v=4)](https://github.com/frankflynter "frankflynter (9 commits)")[![mrmuminov](https://avatars.githubusercontent.com/u/64766486?v=4)](https://github.com/mrmuminov "mrmuminov (1 commits)")[![marcovtwout](https://avatars.githubusercontent.com/u/438046?v=4)](https://github.com/marcovtwout "marcovtwout (1 commits)")[![hyncica](https://avatars.githubusercontent.com/u/11272692?v=4)](https://github.com/hyncica "hyncica (1 commits)")[![margori](https://avatars.githubusercontent.com/u/1149126?v=4)](https://github.com/margori "margori (1 commits)")

### Embed Badge

![Health badge](/badges/frank-symfonymailer-for-yii2/health.svg)

```
[![Health](https://phpackages.com/badges/frank-symfonymailer-for-yii2/health.svg)](https://phpackages.com/packages/frank-symfonymailer-for-yii2)
```

###  Alternatives

[tijsverkoyen/css-to-inline-styles

CssToInlineStyles is a class that enables you to convert HTML-pages/files into HTML-pages/files with inline styles. This is very useful when you're sending emails.

5.8k505.3M227](/packages/tijsverkoyen-css-to-inline-styles)[minishlink/web-push

Web Push library for PHP

1.9k12.0M53](/packages/minishlink-web-push)[laravel-notification-channels/twilio

Provides Twilio notification channel for Laravel

2587.7M12](/packages/laravel-notification-channels-twilio)[spatie/url-signer

Generate a url with an expiration date and signature to prevent unauthorized access

4422.3M16](/packages/spatie-url-signer)[mattketmo/email-checker

Throwaway email detection library

2742.0M5](/packages/mattketmo-email-checker)[laravel-notification-channels/discord

Laravel notification driver for Discord.

2371.3M11](/packages/laravel-notification-channels-discord)

PHPackages © 2026

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