The end of Swiftmailer

The Symfony Mailer component was released for the first time in Symfony 4.3, released in May 2019. Since then, we have worked on improving it by adding more third-party providers and adding some missing features that were already available in Swiftmailer, like DKIM support and email signing. As of Symfony 5.3, all Swiftmailer great features and more are available in Symfony Mailer. Now comes the time to officially end the maintenance of Swiftmailer in favor of Symfony Mailer. I've set the end of maintenance date to the end of November 2021, at the same time as the Symfony 5.4 LTS and 6.0 release. Symfony Mailer could actually have been called Swiftmailer version 7 and the work started exactly as the next major version of Swiftmailer. Let's dive a bit into how I decided to create Symfony Mailer instead of releasing Swiftmailer 7. The current code infrastructure for Swiftmailer was designed for version 4.0, which was roughly released at the same time as symfony 1.2! For many years, I've tried to work on modernizing the Swiftmailer code base one step at a time by trying to introduce namespaces, move to the Composer autoloader, trying to remove the special (and heavy) "boot sequence", trying to switch to the Symfony dependency injection and event dispatcher components. But all my efforts always finished as dead ends, probably because the task was too important for little benefits as Swiftmailer suffers from many more conceptual issues: it has a weird and complex class inheritance and message instances are not data objects which makes it painful to serialize them. It also lacks some modern features like supporting Twig for composing emails and support for third-party providers. Both features could have been added to the current code base, but it would have been ideal. Another issue is the way Swiftmailer uses a "spool" mechanism to support asynchronous emails; it barely works and it's not very flexible. I can go on and on, but you get the idea. So, at some point, I decided to start again, but with a very different and radical approach. Instead of trying to modernize the code one step at a time, I've copied the code and started to first work on isolating a Symfony Mime component. Then, I refactored the rest of the code base as much as possible to create Symfony Mailer. The result is Symfony Mailer. Symfony Mailer has quite a lot of code in common with Swiftmailer but none of its idiosyncrasies. Migrating from Swiftmailer to Symfony Mailer is a relatively easy task as the concepts are the same between the two projects.

                Sponsor the Symfony project.

http://feedproxy.google.com/~r/symfony/blog/~3/bEELWgMiLak/the-end-of-swiftmailer

Created 3y | Aug 19, 2021, 8:20:07 AM


Login to add comment

Other posts in this group

SymfonyOnline June 2024: Leveraging Symfony UX in a Real Application

SymfonyOnline June 2024 is just around the corner and will start on:

June 4-5: Workshop days. It is possible to attend 1 two-day training or 2 one-day trainings! June 6-7: Online conference

May 3, 2024, 4:10:04 PM | Symfony
SymfonyLive Berlin 2024: Enhancing your customers' search experience with Gally

SymfonyLive Berlin 2024 is just around the corner and will start on June 20-21. Get ready for the impressive lineup of speakers and topics. Visit here to more details and don't miss out on this

May 2, 2024, 2:40:03 PM | Symfony
Symfony 7.1.0-BETA1 released

Symfony 7.1.0-BETA1 has just been released. Here is the list of the most important changes since 7.0:

feature #54818 [Translation] Crowdin is backing its translation bridge, thanks to them! \o/ (
May 2, 2024, 2:40:03 PM | Symfony
SymfonyOnline June 2024: Need for Speed: Removing speed bumps from your projects

SymfonyOnline June 2024 is just around the corner and will start on:

June 4-5: Workshop days. It is possible to attend 1 two-day training or 2 one-day trainings! June 6-7: Online conference d

May 1, 2024, 3:50:13 PM | Symfony
SymfonyLive Berlin 2024: Strict PHP

SymfonyLive Berlin 2024 is just around the corner and will start on June 20-21. Get ready for the impressive lineup of speakers and topics. Visit here to more details and don't miss out on this

Apr 30, 2024, 2:40:26 PM | Symfony
Symfony 7.0.7 released

Symfony 7.0.7 has just been released. Here is the list of the most important changes since 7.0.6:

bug #54699 [DoctrineBridge] Update AbstractSchemaListener to adjust more database params (@ywisax
Apr 29, 2024, 3:50:30 PM | Symfony
Symfony 5.4.39 released

Symfony 5.4.39 has just been released. Here is the list of the most important changes since 5.4.38:

bug #54751 [Validator]  detect wrong e-mail validation modes (@xabbuh)

bug #54723 [Form] read f

Apr 29, 2024, 1:40:08 PM | Symfony