This is the official repository of the TYPO3 extension powermail! Powermail is a well-known, editor-friendly, powerful and easy mailform extension for TYPO3
create simple form with a field which is marked as sender email
Now fill out form in FE and use a wrong email address
Expected result: After sending the form, I would expect an error message.
Actual result: no error message, only log message in error log (logging framework)
I do have a log message, so I know an exception is thrown:
Tue, 13 Aug 2024 15:31:18 +0200 [CRITICAL] request="97db7bed8235d" component="In2code.Powermail.Controller.FormController": Mail could not be sent - {"0":"Expected response code \"250/251/252\" but got code \"550\", with message \"550 5.1.1 <fehlerhafte-email@whatever-this-is-wrong.de>... User unknown\".","url":"https://mysite.de/test/powermail/powermail-einfaches-formular_intranet?tx_powermail_pi1%5Baction%5D=checkCreate&tx_powermail_pi1%5Bcontroller%5D=Form&cHash=ff72d9da8605e047124607eb4cc8e6c1"}
Possible fix
Fix in FormController:sendMailPreflight
} catch (Throwable $exception) {
$logger = ObjectUtility::getLogger(__CLASS__);
$logger->critical('Mail could not be sent', [$exception->getMessage()]);
+ $this->addFlashMessage(
+ LocalizationUtility::translate('error_mail_not_created'),
+ '',
+ \TYPO3\CMS\Core\Type\ContextualFeedbackSeverity::ERROR
+ );
+ $this->messageClass = 'error';
}
(ideally a more specific message would be displayed - we know email sending failed and we could even differentiate between mail to sender and mail to receiver.)
Additionally: Ideally a more specific message would be displayed - we know email sending failed and we could even differentiate between mail to sender and mail to receiver.
This is related to https://github.com/in2code-de/powermail/issues/1087, but not the same issue. In fact, to solve https://github.com/in2code-de/powermail/issues/1087 I am using a patched version.
Reproduce
I do have a log message, so I know an exception is thrown:
Tue, 13 Aug 2024 15:31:18 +0200 [CRITICAL] request="97db7bed8235d" component="In2code.Powermail.Controller.FormController": Mail could not be sent - {"0":"Expected response code \"250/251/252\" but got code \"550\", with message \"550 5.1.1 <fehlerhafte-email@whatever-this-is-wrong.de>... User unknown\".","url":"https://mysite.de/test/powermail/powermail-einfaches-formular_intranet?tx_powermail_pi1%5Baction%5D=checkCreate&tx_powermail_pi1%5Bcontroller%5D=Form&cHash=ff72d9da8605e047124607eb4cc8e6c1"}
Possible fix
Fix in FormController:sendMailPreflight
https://github.com/in2code-de/powermail/blob/master/Classes/Controller/FormController.php#L394
(ideally a more specific message would be displayed - we know email sending failed and we could even differentiate between mail to sender and mail to receiver.)
Versions