PHPackages                             symfony/mailer - 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. symfony/mailer

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

symfony/mailer
==============

Helps sending emails

v8.0.6(2mo ago)1.6k368.1M—5%4920MITPHPPHP &gt;=8.4

Since Apr 26Pushed 5d ago12 watchersCompare

[ Source](https://github.com/symfony/mailer)[ Packagist](https://packagist.org/packages/symfony/mailer)[ Docs](https://symfony.com)[ Fund](https://symfony.com/sponsor)[ GitHub Sponsors](https://github.com/fabpot)[ RSS](/packages/symfony-mailer/feed)WikiDiscussions 8.1 Synced 1mo ago

READMEChangelog (10)Dependencies (20)Versions (276)Used By (20)

Mailer Component
================

[](#mailer-component)

The Mailer component helps sending emails.

Getting Started
---------------

[](#getting-started)

```
composer require symfony/mailer
```

```
use Symfony\Component\Mailer\Transport;
use Symfony\Component\Mailer\Mailer;
use Symfony\Component\Mime\Email;

$transport = Transport::fromDsn('smtp://localhost');
$mailer = new Mailer($transport);

$email = (new Email())
    ->from('hello@example.com')
    ->to('you@example.com')
    //->cc('cc@example.com')
    //->bcc('bcc@example.com')
    //->replyTo('fabien@example.com')
    //->priority(Email::PRIORITY_HIGH)
    ->subject('Time for Symfony Mailer!')
    ->text('Sending emails is fun again!')
    ->html('See Twig integration for better HTML integration!');

$mailer->send($email);
```

To enable the Twig integration of the Mailer, require `symfony/twig-bridge` and set up the `BodyRenderer`:

```
use Symfony\Bridge\Twig\Mime\BodyRenderer;
use Symfony\Bridge\Twig\Mime\TemplatedEmail;
use Symfony\Component\EventDispatcher\EventDispatcher;
use Symfony\Component\Mailer\EventListener\MessageListener;
use Symfony\Component\Mailer\Mailer;
use Symfony\Component\Mailer\Transport;
use Twig\Environment as TwigEnvironment;

$twig = new TwigEnvironment(...);
$messageListener = new MessageListener(null, new BodyRenderer($twig));

$eventDispatcher = new EventDispatcher();
$eventDispatcher->addSubscriber($messageListener);

$transport = Transport::fromDsn('smtp://localhost', $eventDispatcher);
$mailer = new Mailer($transport, null, $eventDispatcher);

$email = (new TemplatedEmail())
    // ...
    ->htmlTemplate('emails/signup.html.twig')
    ->context([
        'expiration_date' => new \DateTimeImmutable('+7 days'),
        'username' => 'foo',
    ])
;
$mailer->send($email);
```

Sponsor
-------

[](#sponsor)

Help Symfony by [sponsoring](https://symfony.com/sponsor) its development!

Resources
---------

[](#resources)

- [Documentation](https://symfony.com/doc/current/mailer.html)
- [Contributing](https://symfony.com/doc/current/contributing/index.html)
- [Report issues](https://github.com/symfony/symfony/issues) and [send Pull Requests](https://github.com/symfony/symfony/pulls)in the [main Symfony repository](https://github.com/symfony/symfony)

###  Health Score

84

—

ExcellentBetter than 100% of packages

Maintenance93

Actively maintained with recent releases

Popularity80

Widely adopted with strong download metrics

Community54

Growing community involvement

Maturity96

Battle-tested with a long release history

 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.

###  Release Activity

Cadence

Every ~9 days

Recently: every ~0 days

Total

276

Last Release

82d ago

Major Versions

v6.4.31 → v7.3.92025-12-16

v7.4.3 → v8.0.32025-12-16

v7.4.4 → v8.0.42026-01-08

v6.4.34 → v7.4.62026-02-25

7.4.x-dev → 8.0.x-dev2026-02-25

PHP version history (9 changes)v4.3.0-BETA1PHP ^7.1.3

v5.0.0-BETA1PHP ^7.2.9

v5.0.0PHP ^7.2.5

v5.1.0-RC2PHP &gt;=7.2.5

v4.4.9PHP &gt;=7.1.3

v6.0.0-BETA1PHP &gt;=8.0.2

v6.1.0-BETA1PHP &gt;=8.1

v7.0.0-BETA1PHP &gt;=8.2

v8.0.0-BETA1PHP &gt;=8.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/47313?v=4)[Fabien Potencier](/maintainers/fabpot)[@fabpot](https://github.com/fabpot)

---

Top Contributors

[![nicolas-grekas](https://avatars.githubusercontent.com/u/243674?v=4)](https://github.com/nicolas-grekas "nicolas-grekas (352 commits)")[![fabpot](https://avatars.githubusercontent.com/u/47313?v=4)](https://github.com/fabpot "fabpot (279 commits)")[![xabbuh](https://avatars.githubusercontent.com/u/1957048?v=4)](https://github.com/xabbuh "xabbuh (73 commits)")[![derrabus](https://avatars.githubusercontent.com/u/1506493?v=4)](https://github.com/derrabus "derrabus (68 commits)")[![alexandre-daubois](https://avatars.githubusercontent.com/u/2144837?v=4)](https://github.com/alexandre-daubois "alexandre-daubois (13 commits)")[![OskarStark](https://avatars.githubusercontent.com/u/995707?v=4)](https://github.com/OskarStark "OskarStark (13 commits)")[![chalasr](https://avatars.githubusercontent.com/u/7502063?v=4)](https://github.com/chalasr "chalasr (10 commits)")[![fancyweb](https://avatars.githubusercontent.com/u/3658119?v=4)](https://github.com/fancyweb "fancyweb (9 commits)")[![keradus](https://avatars.githubusercontent.com/u/2716794?v=4)](https://github.com/keradus "keradus (7 commits)")[![Tobion](https://avatars.githubusercontent.com/u/610090?v=4)](https://github.com/Tobion "Tobion (7 commits)")[![lyrixx](https://avatars.githubusercontent.com/u/408368?v=4)](https://github.com/lyrixx "lyrixx (7 commits)")[![arnt](https://avatars.githubusercontent.com/u/236384?v=4)](https://github.com/arnt "arnt (6 commits)")[![jderusse](https://avatars.githubusercontent.com/u/578547?v=4)](https://github.com/jderusse "jderusse (6 commits)")[![wouterj](https://avatars.githubusercontent.com/u/749025?v=4)](https://github.com/wouterj "wouterj (6 commits)")[![Koc](https://avatars.githubusercontent.com/u/191082?v=4)](https://github.com/Koc "Koc (5 commits)")[![kbond](https://avatars.githubusercontent.com/u/127811?v=4)](https://github.com/kbond "kbond (4 commits)")[![plandolt](https://avatars.githubusercontent.com/u/922919?v=4)](https://github.com/plandolt "plandolt (3 commits)")[![bytestream](https://avatars.githubusercontent.com/u/1788397?v=4)](https://github.com/bytestream "bytestream (3 commits)")[![jnoordsij](https://avatars.githubusercontent.com/u/45041769?v=4)](https://github.com/jnoordsij "jnoordsij (2 commits)")[![GromNaN](https://avatars.githubusercontent.com/u/400034?v=4)](https://github.com/GromNaN "GromNaN (2 commits)")

---

Tags

componentphpsymfonysymfony-component

### Embed Badge

![Health badge](/badges/symfony-mailer/health.svg)

```
[![Health](https://phpackages.com/badges/symfony-mailer/health.svg)](https://phpackages.com/packages/symfony-mailer)
```

###  Alternatives

[laravel/framework

The Laravel Framework.

34.7k509.9M17.0k](/packages/laravel-framework)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[drupal/core-recommended

Locked core dependencies; require this project INSTEAD OF drupal/core.

6939.5M343](/packages/drupal-core-recommended)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[drupal/core

Drupal is an open source content management platform powering millions of websites and applications.

19562.3M1.3k](/packages/drupal-core)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)

PHPackages © 2026

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