]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fail when the test mail could not be sent 3899/head
authorJoas Schilling <coding@schilljs.com>
Fri, 17 Mar 2017 12:45:25 +0000 (13:45 +0100)
committerJoas Schilling <coding@schilljs.com>
Fri, 17 Mar 2017 12:45:25 +0000 (13:45 +0100)
Signed-off-by: Joas Schilling <coding@schilljs.com>
settings/Controller/MailSettingsController.php

index 108ac3f393a58399d477199ea8867daa5c6e05de..8137b4da53cbec975c1d9ff41c8756f67f626c1a 100644 (file)
@@ -153,7 +153,10 @@ class MailSettingsController extends Controller {
                                $message->setFrom([$this->defaultMailAddress]);
                                $message->setSubject($this->l10n->t('test email settings'));
                                $message->setPlainBody('If you received this email, the settings seem to be correct.');
-                               $this->mailer->send($message);
+                               $errors = $this->mailer->send($message);
+                               if (!empty($errors)) {
+                                       throw new \RuntimeException($this->l10n->t('Mail could not be sent. Check your mail server log'));
+                               }
                        } catch (\Exception $e) {
                                return [
                                        'data' => [