summaryrefslogtreecommitdiffstats
path: root/settings
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2017-03-17 13:45:25 +0100
committerJoas Schilling <coding@schilljs.com>2017-03-17 13:45:25 +0100
commit4caae91b832b1684351c16f28ee3a8c597b70889 (patch)
tree69754548f5bf8e58d8cc0fa81d5aaa150009e9f4 /settings
parenta5c8016c8b7c50f73b7a16b6bd2284ed06f35d8e (diff)
downloadnextcloud-server-4caae91b832b1684351c16f28ee3a8c597b70889.tar.gz
nextcloud-server-4caae91b832b1684351c16f28ee3a8c597b70889.zip
Fail when the test mail could not be sent
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'settings')
-rw-r--r--settings/Controller/MailSettingsController.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/settings/Controller/MailSettingsController.php b/settings/Controller/MailSettingsController.php
index 108ac3f393a..8137b4da53c 100644
--- a/settings/Controller/MailSettingsController.php
+++ b/settings/Controller/MailSettingsController.php
@@ -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' => [