When SwiftMailer was the standard component for sending E. mail in Symfony, we could use "enqueue" as a simple means of saving E. mails to a text file that could be easily be tested and debugged.
Often, during testing and debugging, we don't want to bother with actually sending the E. mail and all that malarkey with transports and protocols.
With the new Symfony Mailer Component this isn't so easy to do.
But we can, edit our .env.local
, .env.dev
, or .env
file to include:
MAILER_URL=null://null
And then edit vendor/symfony/mailer/Transport/NullTransport.php
and paste this code into the doSend
method: