Issue Bug Closed

#93196Mail API, ArgumentCountError

Mayer Patrick 12/31/20, 15:06 updated 02/23/21, 13:13

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',
],

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.