symfony/swiftmailer-bundle
's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.Name | Version | Size | License | Type | Vulnerabilities |
---|---|---|---|---|---|
swiftmailer/swiftmailer | v6.3.0 | 249.57 kB | MIT | prod | 1 |
symfony/config | v5.4.39 | - | MIT | prod dev | |
symfony/dependency-injection | v5.4.39 | - | MIT | prod dev | |
symfony/http-kernel | v5.4.39 | - | MIT | prod dev |
The Symfony SwiftmailerBundle is a package that provides functionalities for sending emails. However, it's worth noting that this bundle is no longer maintained as of November 2021 since Swiftmailer itself is also unmaintained. It was designed to support modern PHP code and support for third-party providers. SwiftmailerBundle was, thus, the go-to library for handling emails in Symfony-based applications. Nevertheless, developers are now encouraged to switch to Symfony Mailer, which serves as Swiftmailer's successor affording similar functionalities but with continued support.
Using the Symfony SwiftmailerBundle begins with the installation process. You install the package via composer using the command composer require symfony/swiftmailer-bundle
. Once installed, you can typically use SwiftmailerBundle to send emails in a Symfony application as shown in the example below. However, remember this bundle is no longer maintained; switching to Symfony Mailer is recommended. The code usage example:
$message = (new \Swift_Message('Hello Email'))
->setFrom('send@example.com')
->setTo('receiver@example.com')
->setBody(
$this->renderView(
'emails/registration.html.twig',
['name' => $name]
),
'text/html'
);
$mailer->send($message);
The documentation for the Symfony SwiftmailerBundle is no longer maintained alongside the package. It's recommended that developers migrate to Symfony Mailer, which is the next evolution of Swiftmailer. The Symfony Mailer documentation is regularly updated and provides comprehensive information on how to make the shift from Swiftmailer, integrate it into your Symfony project and utilize its features.