Actions
Bug #93196
closedMail API, ArgumentCountError
Start date:
2020-12-31
Due date:
% Done:
0%
Estimated time:
TYPO3 Version:
10
PHP Version:
7.3
Tags:
Mail API documentation
Complexity:
Is Regression:
Sprint Focus:
Description
I tried to use the Mail API, Version 10.4.12
1. Admin Tools / Environment / Test Mail Setup:
Result: no email, no error message, nothing ...
2. Test as follows: (Send email with MailMessage)
GeneralUtility::makeInstance(MailMessage::class)
->from(new Address('mySender@myServer.ch', 'myCompany'))
->to(new Address('me.me@provider.ch', 'me'))
->replyTo('mySender@myServer.ch')
->subject('Wakeup reminder')
->text('Hi, I wrote you a slack message.')
->html('<h4>Hi</h4><p>I wrote you an interesting slack message.</p>')
->send();
Result: email received, everything OK
3. Test as follows: (Send email with FluidEmail)
$email = GeneralUtility::makeInstance(FluidEmail::class);
$email
->to(new Address('me.me@provider.ch', 'me'))
->from(new Address('mySender@myServer.ch', 'myCompany'))
->subject('Message')
->format('html') // only HTML mail
->setTemplate('Default');
GeneralUtility::makeInstance(Mailer::class)->send($email);
Result:
(1/1) ArgumentCountError
Too few arguments to function Symfony\Component\Mailer\Mailer::__construct(), 0 passed in /home/.../www/.../typo3_src-10.4.12/typo3/sysext/core/Classes/Utility/GeneralUtility.php on line 3431 and at least 1 expected
My settings:
LocalConfiguration.php
'MAIL' => [
'layoutRootPaths' => [
'EXT:core/Resources/Private/Layouts/',
'EXT:backend/Resources/Private/Layouts/',
],
'templateRootPaths' => [
'EXT:core/Resources/Private/Templates/Email/',
'EXT:backend/Resources/Private/Templates/Email/',
],
'transport' => 'sendmail',
'transport_sendmail_command' => '/usr/sbin/sendmail -t -i',
],
Files
Actions