Skip to content

[Mailer] Sending Messages Async should not be default behavior  #17072

Closed
@glukose

Description

@glukose

Symfony version(s) affected

6.0

Description

Hello,

When creating a new symfony webapp project symfony new my_project_directory --webapp I couldn't send any email.
The debug toolbar was displaying the email being queued but nothing was sent.
I spent quite some time to check, url_encode et double check my MAILER_DSN value but without any success.
No exception was raised either.

I then got to this chapter in the docs :
https://symfony.com/doc/current/mailer.html#sending-messages-async
which is clearly stating : "When you call $mailer->send($email), the email is sent to the transport immediately." but on the default configuration that is not the case.

I found out that if I comment the default configuration in messenger.yaml
#Symfony\Component\Mailer\Messenger\SendEmailMessage: async or set it to null my email is sent normally.

This is quite confusing for someone used to send email with Symfony (which is the most common use case I believe).

Should the docs be changed to take into account the messenger default conf ? Or should the configuration file for messenger be changed ?

Cheers

How to reproduce

creating a new symfony webapp project symfony new my_project_directory --webapp and send an email like in https://symfony.com/doc/current/mailer.html#creating-sending-messages

Possible Solution

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions