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

Établi 4y | 19 août 2021, 08:20:07


Connectez-vous pour ajouter un commentaire

Autres messages de ce groupe

A Week of Symfony #950 (March 10–16, 2025)

This week, the upcoming Symfony 7.3 version updated lazy services to use PHP native lazy objects and added a feature to define global translation parameters. Meanwhile, the existing Symfony versions f

16 mars 2025, 11:50:02 | Symfony
In Paris or Berlin - Take the lightning talks challenge!

SymfonyLive Paris 2025 (March 27 – 28) and SymfonyLive Berlin 2025 (April 3 – 4) are fast approaching! While an incredible lineup of speakers and topics has already been announced, you still have a ch

13 mars 2025, 14:10:42 | Symfony
SymfonyLive Berlin 2025: Running Symfony in a Multi-Process Container

SymfonyLive Berlin 2025, conference held in English, will take place from April 1 to 4! The schedule is being revealed gradually. More details are available here.

We’re thrilled to announce

11 mars 2025, 15:30:03 | Symfony
A Week of Symfony #949 (3-9 March 2025)

This week, the upcoming Symfony 7.3 version renamed the JsonEncoder component to JsonStreamer, added support for Valkey schemes in the Cache component and introduced a field_id() form helper.

Symfony

9 mars 2025, 10:10:11 | Symfony
SymfonyLive Paris 2025 : Où sont passées les femmes de l'histoire de la tech ?

SymfonyLive Paris 2025, conference in French language only, will take place from March 27 to 28! The schedule is currently being revealed as we go along. More details are available here.

Al

7 mars 2025, 11:40:12 | Symfony
SymfonyLive Berlin 2025: CI in PHP Projects: Automate Everything with Your Personal Army of Robots

SymfonyLive Berlin 2025, conference held in English, will take place from April 1 to 4! The schedule is being revealed gradually. More details are available here.

We’re thrilled to announce

5 mars 2025, 08:40:26 | Symfony
SymfonyLive Paris 2025 : API Platform sans Doctrine

SymfonyLive Paris 2025, conference in French language only, will take place from March 27 to 28! The schedule is currently being revealed as we go along. More details are available here.

Al

4 mars 2025, 11:50:05 | Symfony