Bug #89083

MailMessage setFrom and setTo are throwing exceptions

Added by Sebastian Fischer 2 months ago. Updated about 1 month ago.

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

100%

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).


Related issues

Related to TYPO3 Core - Bug #88702: EmailFinisher - Recipients - Cannot unpack array with string keys Resolved 2019-07-08
Related to TYPO3 Core - Feature #88643: Replace SwiftMailer with Symfony/Mailer Closed 2019-07-05
Related to TYPO3 Core - Bug #89379: Emails sending doesn't work using MailMessage Closed 2019-10-09

Associated revisions

Revision 9fec751a (diff)
Added by Frank Naegler about 1 month ago

[BUGFIX] Add tests and fix broken MailMessage

This patch add tests for the MailMessage class and fix broken
functionality since migration to Symfony Mailer.

Resolves: #89083
Related: #88643
Releases: master
Change-Id: Ieb7616aa24cee26505d0e2260a26b56713caebc1
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/61908
Tested-by: TYPO3com <>
Tested-by: Andreas Fernandez <>
Tested-by: Daniel Goerz <>
Reviewed-by: Andreas Fernandez <>
Reviewed-by: Daniel Goerz <>

History

#1 Updated by Frank Naegler about 1 month ago

  • Status changed from New to In Progress
  • Assignee set to Frank Naegler

#2 Updated by Frank Naegler about 1 month ago

  • Related to Bug #88702: EmailFinisher - Recipients - Cannot unpack array with string keys added

#3 Updated by Frank Naegler about 1 month ago

  • Related to Feature #88643: Replace SwiftMailer with Symfony/Mailer added

#4 Updated by Gerrit Code Review about 1 month ago

  • Status changed from In Progress to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61908

#5 Updated by Gerrit Code Review about 1 month ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61908

#6 Updated by Gerrit Code Review about 1 month ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61908

#7 Updated by Gerrit Code Review about 1 month ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61908

#8 Updated by Gerrit Code Review about 1 month ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61908

#9 Updated by Gerrit Code Review about 1 month ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61908

#10 Updated by Georg Ringer about 1 month ago

  • Related to Bug #89379: Emails sending doesn't work using MailMessage added

#11 Updated by Frank Naegler about 1 month ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

Also available in: Atom PDF