'Catch failed recipients in Symfony/Mailer 6.x?

In want replace deprecated SwiftMailer v6.3.0 with new Symfony/Mailer v6.x. In old SwiftMailer I collect failed recipients so that I know who has not received mail.

$successfulRecipients = $mailer->send($message, $failedRecipients);

Symfony/Mailer is not working this way. How do I find failed recipients in Symfony/Mailer? Maybe with try/catch for TransportExceptionInterface but there is no example what exactly is returned.

How do I get the mail addresses which have not received the mail? Because maybe their mailbox was full or the mail was too big?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source