#90320Swift_RfcComplianceException for invalid email in MailMessage->setTo()
Description
There is a bug in the swiftmailer implementation in TYPO3 9.5 and 8.7:
GeneralUtility::makeInstance(MailMessage::class)
->setFrom('foo@bar.org')
->setTo('foo@ba r.org')
->setSubject('subject)
->setBody('body')
->send();
throws a Swift_RfcComplianceException
Address in mailbox given [foo@ba r.org] does not comply with RFC 2822, 3.6.2. Swift_RfcComplianceException thrown in file /typo3_src-8.7.30/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/MailboxHeader.php in line 345.
In method MailMessage::send() a Swift_RfcComplianceException would be caught by Mailer::send() and add it to the list of $failedRecipients but MailMessage::setTo() does not.
TYPO3 v10 no longer contains the swiftmailer implementation.
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.