Hello guys i just started to building web using Symfony6 - im trying to send email using mailer however it somehow require database to be configured (+ some special table created for messages...).Maybe there is some workaround so it would work without DB.. - thing is in Symfony 5 there was no problem with that.
By default it's configured to work in async mode via messenger, that's why @glukose 's answer works. It sets sync mode and emails are sent immediately that way.
Your messenger is configured to work via Doctrine, that's why it requires DB. Like this:
MESSENGER_TRANSPORT_DSN=doctrine://default
You can use many other options, like Redis or AMQP, async mode is used for a reason after all.
Anyway async mode won't work without workers started with command php bin/console messenger:consume async
. That was my problem because I wasn't aware about what was used. No errors, but emails are not actually sent with Symfony mailer!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With