500 Internal Server Error Email not sending

Your software
My Mautic version is: mautic 5.0.0
My PHP version is: 8.1.29
My Database type and version is: 10.6.16-MariaDB-0ubuntu0.22.04.1

Your problem
My problem is: Email not sending showing 500 internal server error

These errors are showing in the log:
[2024-06-18T19:16:52.143540+00:00] mautic.CRITICAL: Uncaught PHP Exception TypeError: “str_ireplace(): Argument #3 ($subject) must be of type array|string, Symfony\Component\Mime\Address given” at /var/www/html/mautic/docroot/app/bundles/EmailBundle/Helper/MailHelper.php line 699 {“exception”:“[object] (TypeError(code: 0): str_ireplace(): Argument #3 ($subject) must be of type array|string, Symfony\Component\Mime\Address given at /var/www/html/mautic/docroot/app/bundles/EmailBundle/Helper/MailHelper.php:699)”} {“hostname”:“mautic5a”,“pid”:895551}

Steps I have tried to fix the problem:
I have reconfigure my DNS with SMTP transporter the test connection show success and I received the test mail. But sending gives me error 500

Please help since I don’t want to break my mautic

Did you get this resolved?

Got error ‘…PHP message: PHP 18. Mautic\EmailBundle\Helper\MailHelper->queue($dispatchSendEvent = TRUE, $returnMode = uninitialized) /app/bundles/EmailBundle/Model/EmailModel.php:2214PHP message: PHP 19. Mautic\EmailBundle\Helper\MailHelper->send($dispatchSendEvent = TRUE, $isQueueFlush = uninitialized) /app/bundles/EmailBundle/Helper/MailHelper.php:460PHP message: PHP 20. Mautic\EmailBundle\Helper\MailHelper->generateBounceEmail($idHash = uninitialized) /app/bundles/EmailBundle/Helper/MailHelper.php:312’, referrer: https://mautic.domain.com/s/emails/view/1

Anyone solved this? the test email sending from server hostname “hostname.domain.com” instead of “myemail@domain.com