diff --git a/core/modules/user/lib/Drupal/user/RegisterFormController.php b/core/modules/user/lib/Drupal/user/RegisterFormController.php
index 2a84412..f84a3df 100644
--- a/core/modules/user/lib/Drupal/user/RegisterFormController.php
+++ b/core/modules/user/lib/Drupal/user/RegisterFormController.php
@@ -131,13 +131,14 @@ class RegisterFormController extends AccountFormController {
       }
       else {
         $op = $notify ? 'register_admin_created' : 'register_no_approval_required';
-        _user_mail_notify($op, $account);
-        if ($notify) {
-          drupal_set_message(t('A welcome message with further instructions has been e-mailed to the new user <a href="@url">%name</a>.', array('@url' => url($uri['path'], $uri['options']), '%name' => $account->name)));
-        }
-        else {
-          drupal_set_message(t('A welcome message with further instructions has been sent to your e-mail address.'));
-          $form_state['redirect'] = '';
+        if (_user_mail_notify($op, $account)) {
+          if ($notify) {
+            drupal_set_message(t('A welcome message with further instructions has been e-mailed to the new user <a href="@url">%name</a>.', array('@url' => url($uri['path'], $uri['options']), '%name' => $account->name)));
+          }
+          else {
+            drupal_set_message(t('A welcome message with further instructions has been sent to your e-mail address.'));
+            $form_state['redirect'] = '';
+          }
         }
       }
     }
diff --git a/core/modules/user/lib/Drupal/user/Tests/UserCreateFailMailTest.php b/core/modules/user/lib/Drupal/user/Tests/UserCreateFailMailTest.php
new file mode 100644
index 0000000..a8b2a98
--- /dev/null
+++ b/core/modules/user/lib/Drupal/user/Tests/UserCreateFailMailTest.php
@@ -0,0 +1,53 @@
+<?php
+
+/**
+ * @file
+ * Contains Drupal\user\Tests\UserCreateFailMailTest.
+ */
+
+namespace Drupal\user\Tests;
+
+use Drupal\simpletest\WebTestBase;
+
+/**
+ * Tests the create user administration page.
+ */
+class UserCreateFailMailTest extends WebTestBase {
+
+  /**
+   * Enable the user_mail_failure_test module.
+   */
+  public static $modules = array('user_mail_failure_test');
+
+  public static function getInfo() {
+    return array(
+      'name' => 'User create with failed mail function',
+      'description' => 'Test the create user administration page.',
+      'group' => 'User',
+    );
+  }
+
+  /**
+   * Tests the create user administration page.
+   */
+  protected function testUserAdd() {
+    $user = $this->drupalCreateUser(array('administer users'));
+    $this->drupalLogin($user);
+
+    // Replace the mail functionality with a fake, malfunctioning service.
+    config('system.mail')->set('interface.default', 'Drupal\user_mail_failure_test\TestPhpMailFailure')->save();
+    // Create a user, but fail to send an email.
+    $name = $this->randomName();
+    $edit = array(
+      'name' => $name,
+      'mail' => $this->randomName() . '@example.com',
+      'pass[pass1]' => $pass = $this->randomString(),
+      'pass[pass2]' => $pass,
+      'notify' => TRUE,
+    );
+    $this->drupalPost('admin/people/create', $edit, t('Create new account'));
+
+    $this->assertText(t('Unable to send e-mail. Contact the site administrator if the problem persists.'));
+    $this->assertNoText(t('A welcome message with further instructions has been e-mailed to the new user @name.', array('@name' => $edit['name'])));
+  }
+}
diff --git a/core/modules/user/tests/modules/user_mail_failure_test/lib/Drupal/user_mail_failure_test/TestPhpMailFailure.php b/core/modules/user/tests/modules/user_mail_failure_test/lib/Drupal/user_mail_failure_test/TestPhpMailFailure.php
new file mode 100644
index 0000000..10bc9c9
--- /dev/null
+++ b/core/modules/user/tests/modules/user_mail_failure_test/lib/Drupal/user_mail_failure_test/TestPhpMailFailure.php
@@ -0,0 +1,27 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\user_mail_failure_test\TestPhpMailFailure.
+ */
+
+namespace Drupal\user_mail_failure_test;
+
+use Drupal\Core\Mail\PhpMail;
+use Drupal\Core\Mail\MailInterface;
+
+/**
+ * Defines a mail sending implementation that return false.
+ *
+ * This class is for running tests or for development.
+ */
+class TestPhpMailFailure extends PhpMail implements MailInterface {
+
+  /**
+   * Overrides Drupal\Core\Mail\PhpMail::mail().
+   */
+  public function mail(array $message) {
+    // Instead of attempting to send a message, just return failure.
+    return FALSE;
+  }
+}
diff --git a/core/modules/user/tests/modules/user_mail_failure_test/user_mail_failure_test.info.yml b/core/modules/user/tests/modules/user_mail_failure_test/user_mail_failure_test.info.yml
new file mode 100644
index 0000000..139a601
--- /dev/null
+++ b/core/modules/user/tests/modules/user_mail_failure_test/user_mail_failure_test.info.yml
@@ -0,0 +1,8 @@
+name: 'User mail failure test'
+description: 'Create situation of mail failure.'
+package: Testing
+version: VERSION
+core: 8.x
+dependencies:
+  - user
+hidden: true
diff --git a/core/modules/user/tests/modules/user_mail_failure_test/user_mail_failure_test.module b/core/modules/user/tests/modules/user_mail_failure_test/user_mail_failure_test.module
new file mode 100644
index 0000000..5015a01
--- /dev/null
+++ b/core/modules/user/tests/modules/user_mail_failure_test/user_mail_failure_test.module
@@ -0,0 +1,7 @@
+<?php
+
+/**
+ * @file
+ * Disables the email function for testing purpose.
+ */
+
