diff --git a/core/modules/contact/src/MailHandler.php b/core/modules/contact/src/MailHandler.php
index 308acf5..67646b0 100644
--- a/core/modules/contact/src/MailHandler.php
+++ b/core/modules/contact/src/MailHandler.php
@@ -23,6 +23,16 @@ class MailHandler implements MailHandlerInterface {
   use StringTranslationTrait;
 
   /**
+   * Index to identify the result of the message recipient.
+   */
+  const MESSAGE_RECIPIENT = 'recipient';
+
+  /**
+   * Index to identify the result of the message copy.
+   */
+  const MESSAGE_COPY = 'copy';
+
+  /**
    * Language manager service.
    *
    * @var \Drupal\Core\Language\LanguageManagerInterface
@@ -116,15 +126,15 @@ public function sendMailMessages(MessageInterface $message, AccountInterface $se
 
     // Send email to the recipient(s).
     $key_prefix = $message->isPersonal() ? 'user' : 'page';
-    $this->mailManager->mail('contact', $key_prefix . '_mail', $to, $recipient_langcode, $params, $sender_cloned->getEmail());
+    $message_results[MailHandler::MESSAGE_RECIPIENT] = $this->mailManager->mail('contact', $key_prefix . '_mail', $to, $recipient_langcode, $params, $sender_cloned->getEmail());
 
     // If requested, send a copy to the user, using the current language.
-    if ($message->copySender()) {
-      $this->mailManager->mail('contact', $key_prefix . '_copy', $sender_cloned->getEmail(), $current_langcode, $params, $sender_cloned->getEmail());
+    if ($message->copySender() && $message_results[MailHandler::MESSAGE_RECIPIENT]['result']) {
+      $message_results[MailHandler::MESSAGE_COPY] = $this->mailManager->mail('contact', $key_prefix . '_copy', $sender_cloned->getEmail(), $current_langcode, $params, $sender_cloned->getEmail());
     }
 
     // If configured, send an auto-reply, using the current language.
-    if (!$message->isPersonal() && $contact_form->getReply()) {
+    if (!$message->isPersonal() && $contact_form->getReply() && $message_results[MailHandler::MESSAGE_RECIPIENT]['result']) {
       // User contact forms do not support an auto-reply message, so this
       // message always originates from the site.
       $this->mailManager->mail('contact', 'page_autoreply', $sender_cloned->getEmail(), $current_langcode, $params);
@@ -144,6 +154,8 @@ public function sendMailMessages(MessageInterface $message, AccountInterface $se
         '%recipient-name' => $message->getPersonalRecipient()->getUsername(),
       ));
     }
+
+    return $message_results;
   }
 
 }
diff --git a/core/modules/contact/src/MessageForm.php b/core/modules/contact/src/MessageForm.php
index 78de6dd..2589327 100644
--- a/core/modules/contact/src/MessageForm.php
+++ b/core/modules/contact/src/MessageForm.php
@@ -212,10 +212,19 @@ public function validate(array $form, FormStateInterface $form_state) {
   public function save(array $form, FormStateInterface $form_state) {
     $message = $this->entity;
     $user = $this->currentUser();
-    $this->mailHandler->sendMailMessages($message, $user);
+    $message_results = $this->mailHandler->sendMailMessages($message, $user);
+
+    // \Drupal\Core\Mail\MailManager will display an error message, if the
+    // message couldn't be sent, so only set a message if it was sent.
+    if (!empty($message_results[MailHandler::MESSAGE_RECIPIENT]['result'])) {
+      drupal_set_message($this->t('Your message has been sent.'));
+    }
+
+    if (!empty($message_results[MailHandler::MESSAGE_COPY]['result'])) {
+      drupal_set_message($this->t('Your message copy has been sent.'));
+    }
 
     $this->flood->register('contact', $this->config('contact.settings')->get('flood.interval'));
-    drupal_set_message($this->t('Your message has been sent.'));
 
     // To avoid false error messages caused by flood control, redirect away from
     // the contact form; either to the contacted user account or the front page.
diff --git a/core/modules/contact/src/Tests/NotExistEmailContactTest.php b/core/modules/contact/src/Tests/NotExistEmailContactTest.php
new file mode 100644
index 0000000..269dd00
--- /dev/null
+++ b/core/modules/contact/src/Tests/NotExistEmailContactTest.php
@@ -0,0 +1,76 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\contact\Tests\NotExistEmailContactTest.
+ */
+
+namespace Drupal\contact\Tests;
+
+use Drupal\Component\Utility\Unicode;
+use Drupal\contact\Entity\ContactForm;
+use Drupal\Core\Mail\MailFormatHelper;
+use Drupal\field_ui\Tests\FieldUiTestTrait;
+use Drupal\simpletest\WebTestBase;
+use Drupal\Core\Entity\EntityTypeInterface;
+
+/**
+ * Test messages displayed when contact mail can't be sent.
+ *
+ * @group contact
+ */
+class NotExistEmailContactTest extends WebTestBase {
+
+  use FieldUiTestTrait;
+
+  /**
+   * Modules to enable.
+   *
+   * @var array
+   */
+  public static $modules = ['text', 'contact', 'contact_test', 'field_ui', 'system_mail_failure_test'];
+
+  protected function setUp() {
+    parent::setUp();
+  }
+
+  /**
+   * Tests messages displayed when can't send contact mail.
+   */
+  function testPersonalContactFail() {
+    // Create a valid form.
+    $this->admin_user = $this->drupalCreateUser(['access site-wide contact form', 'administer contact forms', 'administer permissions', 'administer users']);
+
+    $this->drupalLogin($this->admin_user);
+    // Create contact form.
+    $edit = [
+      'label' => $this->randomMachineName(16),
+      'id' => Unicode::strtolower($this->randomMachineName(16)),
+      'recipients' => 'test@example.com',
+      'reply' => '',
+      'selected' => TRUE,
+    ];
+    $this->drupalPostForm('admin/structure/contact/add', $edit, t('Save'));
+    $this->assertRaw(t('Contact form %label has been added.', ['%label' => $edit['label']]));
+
+    // Make sure that we can't send mails.
+    $this->config('system.mail')->set('interface.default', 'test_php_mail_failure')->save();
+
+    // Submit the contact form as anonymous user.
+    $this->drupalLogout();
+    $this->drupalGet('/contact');
+    user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, ['access site-wide contact form']);
+    $edit2 = [
+      'name' => 'Test',
+      'mail' => 'test@example.com',
+      'subject[0][value]' => 'Sample Message',
+      'message[0][value]' => 'Hallo world',
+    ];
+    $this->drupalPostForm('contact/' . $edit['id'], $edit2, t('Send message'));
+
+    // Unable to send email message should be displayed
+    $this->assertText(t('Unable to send email. Contact the site administrator if the problem persists.'), 'Displayed "Unable to send email..."');
+    $this->assertNoText(t('Your message has been sent.'), 'Did not display "Message sent"');
+  }
+
+}
