Closed
Description
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:
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