]> source.dussan.org Git - nextcloud-server.git/commitdiff
Add message when trouble sending email ref #1799
authorBrice Maron <brice@bmaron.net>
Wed, 20 Feb 2013 20:14:55 +0000 (21:14 +0100)
committerBrice Maron <brice@bmaron.net>
Wed, 20 Feb 2013 20:14:55 +0000 (21:14 +0100)
core/lostpassword/controller.php

index 3ef8eaf71aa78ae4fb9373fe4ae4a4468ce28601..fbcf4a87f22c876de23c7c7a92338851eca01036 100644 (file)
@@ -44,7 +44,11 @@ class OC_Core_LostPassword_Controller {
                                $msg = $tmpl->fetchPage();
                                $l = OC_L10N::get('core');
                                $from = OCP\Util::getDefaultEmailAddress('lostpassword-noreply');
-                               OC_Mail::send($email, $_POST['user'], $l->t('ownCloud password reset'), $msg, $from, 'ownCloud');
+                               try {
+                                       OC_Mail::send($email, $_POST['user'], $l->t('ownCloud password reset'), $msg, $from, 'ownCloud');
+                               } catch (Exception $e) {
+                                       OC_Template::printErrorPage( 'A problem occurs during sending the e-mail please contact your administrator.');
+                               }
                                self::displayLostPasswordPage(false, true);
                        } else {
                                self::displayLostPasswordPage(true, false);