diff --git a/typo3/sysext/core/Classes/Command/SendEmailCommand.php b/typo3/sysext/core/Classes/Command/SendEmailCommand.php
index 33a18f0dd1b38e86e0d4d1fcea9c3a2a8bb05630..aeaa845f449789e98e725d3552a7be5a09427e4f 100644
--- a/typo3/sysext/core/Classes/Command/SendEmailCommand.php
+++ b/typo3/sysext/core/Classes/Command/SendEmailCommand.php
@@ -52,7 +52,7 @@ class SendEmailCommand extends Command
      *
      * @param InputInterface $input
      * @param OutputInterface $output
-     * @return int|void|null
+     * @return int
      */
     protected function execute(InputInterface $input, OutputInterface $output)
     {
@@ -74,9 +74,11 @@ class SendEmailCommand extends Command
             }
             $sent = $transport->flushQueue($mailer->getRealTransport());
             $io->comment($sent . ' emails sent');
-        } else {
-            $io->error('The Mailer Transport is not set to "spool".');
+            return 0;
         }
+        $io->error('The Mailer Transport is not set to "spool".');
+
+        return 1;
     }
 
     /**