# mailer-symfony
**Repository Path**: mirrors_yiisoft/mailer-symfony
## Basic Information
- **Project Name**: mailer-symfony
- **Description**: Yii Framework Symfony Mailer Integration
- **Primary Language**: Unknown
- **License**: BSD-3-Clause
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2021-08-24
- **Last Updated**: 2026-02-07
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
Yii Mailer - Symfony Mailer Extension
[](https://packagist.org/packages/yiisoft/mailer-symfony)
[](https://packagist.org/packages/yiisoft/mailer-symfony)
[](https://github.com/yiisoft/mailer-symfony/actions/workflows/build.yml)
[](https://codecov.io/gh/yiisoft/mailer-symfony)
[](https://dashboard.stryker-mutator.io/reports/github.com/yiisoft/mailer-symfony/master)
[](https://github.com/yiisoft/mailer-symfony/actions?query=workflow%3A%22static+analysis%22)
[](https://shepherd.dev/github/yiisoft/mailer-symfony)
This package is an adapter for [yiisoft/mailer](https://github.com/yiisoft/mailer) relying on
[symfony/mailer](https://github.com/symfony/mailer).
## Requirements
- PHP 8.1 or higher.
## Installation
The package could be installed with [Composer](https://getcomposer.org):
```shell
composer require yiisoft/mailer-symfony
```
## General usage
Creating a mailer:
```php
use Yiisoft\Mailer\Symfony\Mailer;
/**
* @var \Symfony\Component\Mailer\Transport\TransportInterface $transport
*/
$mailer = new \Yiisoft\Mailer\Symfony\Mailer(
$transport,
);
```
Sending a mail message:
```php
$message = (new \Yiisoft\Mailer\Message())
->withFrom('from@domain.com')
->withTo('to@domain.com')
->withSubject('Message subject')
->withTextBody('Plain text content')
->withHtmlBody('HTML content');
$mailer->send($message);
// Or several
$mailer->sendMultiple([$message]);
```
Additional methods of the `Yiisoft\Mailer\Symfony\Mailer`:
- `withEncryptor()` - Returns a new instance with the specified encryptor instance.
- `withSigner()` - Returns a new instance with the specified signer instance.
For more information about signing and encrypting messages, see the corresponding section of the
[documentation](https://symfony.com/doc/current/mailer.html#signing-and-encrypting-messages).
For use in the [Yii framework](https://www.yiiframework.com/), see the configuration files:
- [`config/di.php`](https://github.com/yiisoft/mailer-symfony/blob/master/config/di.php)
- [`config/params.php`](https://github.com/yiisoft/mailer-symfony/blob/master/config/params.php)
## Documentation
- [Yii guide to mailing](https://github.com/yiisoft/docs/blob/master/guide/en/tutorial/mailing.md)
- [Symfony Mailer documentation](https://symfony.com/doc/current/mailer.html)
- [Internals](docs/internals.md)
If you need help or have a question, the [Yii Forum](https://forum.yiiframework.com/c/yii-3-0/63) is a good place for that.
You may also check out other [Yii Community Resources](https://www.yiiframework.com/community).
## License
The Yii Mailer - Symfony Mailer Extension is free software. It is released under the terms of the BSD License.
Please see [`LICENSE`](./LICENSE.md) for more information.
Maintained by [Yii Software](https://www.yiiframework.com/).
## Support the project
[](https://opencollective.com/yiisoft)
## Follow updates
[](https://www.yiiframework.com/)
[](https://twitter.com/yiiframework)
[](https://t.me/yii3en)
[](https://www.facebook.com/groups/yiitalk)
[](https://yiiframework.com/go/slack)