aboutsummaryrefslogtreecommitdiffstats
path: root/settings
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2017-03-18 10:47:57 +0100
committerGitHub <noreply@github.com>2017-03-18 10:47:57 +0100
commit1febf042d82bbf71ca2ff0179df5c1f3e6bff6fe (patch)
tree98eb6dcbc28a23ecf59f572ee17bb65c46832854 /settings
parent9e1e7dac479f63f194b595e45c05d7bf833622dd (diff)
parent4caae91b832b1684351c16f28ee3a8c597b70889 (diff)
downloadnextcloud-server-1febf042d82bbf71ca2ff0179df5c1f3e6bff6fe.tar.gz
nextcloud-server-1febf042d82bbf71ca2ff0179df5c1f3e6bff6fe.zip
Merge pull request #3899 from nextcloud/issue-3662-not-sending-is-an-error
Fail when the test mail could not be sent
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' => [