Bug #89083

MailMessage setFrom and setTo are throwing exceptions

Added by Sebastian Fischer 18 days ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Miscellaneous
Target version:
-
Start date:
2019-09-04
Due date:
% Done:

0%

TYPO3 Version:
10
PHP Version:
7.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Both setFrom and setTo are not working as documented.

$mail = $this->objectManager->get(\TYPO3\CMS\Core\Mail\MailMessage::class);

$mail->setFrom('');
Exception -> An address can be an instance of Address or a string ("NULL") given).

$mail->setFrom('', 'bbb');
Exception -> Email "bbb" does not comply with addr-spec of RFC 2822.

$mail->setFrom(['' => 'bbb']);
Exception -> An address can be an instance of Address or a string ("array") given).

$mail->setTo(['' => 'aaa']);
Exception -> An address can be an instance of Address or a string ("array") given).

Also available in: Atom PDF