8000 [Mailer] `mailer.envelope.recipients` configuration does not work with sendmail · Issue #46877 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
[Mailer] mailer.envelope.recipients configuration does not work with sendmail #46877
Closed
@alexey-muzyka-1

Description

@alexey-muzyka-1

Symfony version(s) affected

5.4.9

Description

Symfony/Mailer : The recipients feature ("Always Send to the same Address") does not work with sendmail. PHP 8.0

How to reproduce

add to: config/packages/dev/mailer.yaml

framework:
    mailer:
        dsn: '%env(MAILER_DSN)%'
        envelope:
            recipients: ['valid@example.com']
            sender: 'no-reply@test.com'

Create any Email sender

class EmailSender
{
    public function __construct(
        private MailerInterface $mailer,
    ) {
    }

    /**
     * @throws TransportExceptionInterface
     */
    public function send(): void
    {
        $email = (new TemplatedEmail())
            ->to('invalid@test.com')
            ->subject('Test Email)
            ->htmlTemplate('email/template.html.twig');

        $this->mailer->send($email);
    }
}

Process email. I've used mailhog to catch emails. So response is:

image

As you could see. The sender was retrieved from the configurations, but the recipient is not

Possible Solution

No response

Additional Context

It was fixed in this issue

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0