diff --git a/includes/phpmailer.class.inc b/includes/phpmailer.class.inc
index 63fab4c..ccfe1fe 100644
--- a/includes/phpmailer.class.inc
+++ b/includes/phpmailer.class.inc
@@ -16,6 +16,37 @@ class DrupalPHPMailer extends PHPMailer {
   public $ReturnPath = '';
 
   /**
+   * Verbose debug output level configured for Drupal.
+   *
+   * In order to be able to log error messages with actual error information and
+   * see what actually went wrong for a particular message, PHPMailer::SMTPDebug
+   * always needs to be enabled.
+   *
+   * DrupalPHPMailer::SmtpSend() overrides PHPMailer::SmtpSend() to capture the
+   * debug output string and make it available for watchdog() calls.
+   *
+   * @see PHPMailer::SMTPDebug
+   * @see SMTP::do_debug
+   * @see DrupalPHPMailer::SmtpSend()
+   * @see DrupalPHPMailer::drupalDebugOutput
+   *
+   * @var int
+   */
+  public $drupalDebug = 0;
+
+  /**
+   * Overrides PHPMailer::SMTPDebug to capture SMTP communication errors by default.
+   */
+  public $SMTPDebug = 2;
+
+  /**
+   * Stores the verbose debug output of the SMTP communication.
+   *
+   * @var string
+   */
+  public $drupalDebugOutput = '';
+
+  /**
    * Constructor.
    */
   public function __construct() {
@@ -40,7 +71,11 @@ class DrupalPHPMailer extends PHPMailer {
     $this->SMTPAuth = (bool)($this->Username != '' && $this->Password != '');
 
     $this->SMTPKeepAlive = variable_get('smtp_keepalive', 0);
-    $this->SMTPDebug = variable_get('smtp_debug', 0);
+
+    $this->drupalDebug = variable_get('smtp_debug', 0);
+    if ($this->drupalDebug > $this->SMTPDebug) {
+      $this->SMTPDebug = $this->drupalDebug;
+    }
 
     // Adjust path to SMTP class.
     $this->PluginDir = './'. phpmailer_get_path() .'/';
@@ -53,6 +88,8 @@ class DrupalPHPMailer extends PHPMailer {
    */
   public function SmtpSend($header, $body) {
     if ($this->SMTPDebug) {
+      // Clear possibly previously captured debug output.
+      $this->drupalDebugOutput = '';
       ob_start();
     }
 
@@ -67,7 +104,8 @@ class DrupalPHPMailer extends PHPMailer {
     catch (phpmailerException $exception) {}
 
     if ($this->SMTPDebug) {
-      if ($debug = ob_get_contents()) {
+      $this->drupalDebugOutput = ob_get_contents();
+      if ($this->drupalDebug && $this->drupalDebugOutput) {
         drupal_set_message($debug);
       }
       ob_end_clean();
diff --git a/includes/phpmailer.drupal.inc b/includes/phpmailer.drupal.inc
index 0b91d5b..b99ca3c 100644
--- a/includes/phpmailer.drupal.inc
+++ b/includes/phpmailer.drupal.inc
@@ -118,8 +118,57 @@ function phpmailer_send($message) {
     return $mail->Send();
   }
   catch (phpmailerException $e) {
-    drupal_set_message(t('Sending of at least one e-mail failed. The error returned was:<br />@error.', array('@error' => $e->getMessage())), 'error');
-    watchdog('phpmailer', $e->getMessage(), NULL, WATCHDOG_ERROR);
+    // Log the error including verbose debug information.
+    // Since DBLog module is the most common case, we use HTML to format the
+    // message for visual inspection. For sites running with Syslog or other
+    // logging modules, we put the actual values on separate lines (\n), so the
+    // surrounding HTML markup doesn't get too disturbing.
+
+    // Message is a safe t() string from DrupalPHPMailer::SetLanguage().
+    $output = $e->getMessage();
+    $arguments = array();
+    // Append SMTP communication output.
+    if ($mail->drupalDebugOutput) {
+      // PHPMailer debug output contains HTML linebreaks. PRE is more readable.
+      $mail->drupalDebugOutput = str_replace('<br />', '', $mail->drupalDebugOutput);
+      $output .= '<p><strong>Server response:</strong></p>';
+      $output .= "<pre>\n@smtp_output\n</pre>";
+      $arguments += array(
+        '@smtp_output' => $mail->drupalDebugOutput,
+      );
+    }
+    // We need to log the message in order to be able to debug why the server
+    // responded with an error. The mail body may contain passwords and other
+    // sensitive information, which should not be logged. Since all kind of
+    // mails are processed and Drupal provides no way to mark sensible data, it
+    // is technically impossible prevent logging in all cases. This is a best
+    // attempt to at least clean out passwords from User module mails, but known
+    // to be insufficient.
+    $message['body'] = preg_replace('@password: .+@', 'password: - REMOVED -', $message['body']);
+    // Also remove $params; they've already been processed and may contain
+    // sensible data, too.
+    unset($message['params']);
+
+    // Subject.
+    $output .= "<p><strong>Subject:</strong> \n@subject\n</p>";
+    $arguments += array(
+      '@subject' => $message['subject'],
+    );
+    unset($message['subject']);
+    // Body.
+    $output .= '<p><strong>Body:</strong></p>';
+    $output .= "<pre>\n@body\n</pre>";
+    $arguments += array(
+      '@body' => $message['body'],
+    );
+    unset($message['body']);
+    // Rest of $message.
+    $output .= '<p>Message:</p>';
+    $output .= "<pre>\n@message\n</pre>";
+    $arguments += array(
+      '@message' => var_export($message, TRUE),
+    );
+    watchdog('phpmailer', $output, $arguments, WATCHDOG_ERROR);
     return FALSE;
   }
 }
diff --git a/phpmailer.admin.inc b/phpmailer.admin.inc
index 9a53332..2611a8f 100644
--- a/phpmailer.admin.inc
+++ b/phpmailer.admin.inc
@@ -149,14 +149,7 @@ function phpmailer_settings_form($form_state) {
       // is enabled, so drupal_mail_send() cannot be used.
       // @see drupal_mail_send()
       module_load_include('inc', 'phpmailer', 'includes/phpmailer.drupal');
-      $message['result'] = phpmailer_send($message);
-
-      // Log errors
-      // @see drupal_mail()
-      if (!$message['result']) {
-        watchdog('mail', 'Error sending e-mail (from %from to %to).', array('%from' => $message['from'], '%to' => $message['to']), WATCHDOG_ERROR);
-        drupal_set_message(t('Unable to send e-mail. Please contact the site administrator if the problem persists.'), 'error');
-      }
+      phpmailer_send($message);
     }
     drupal_set_message(t('A test e-mail has been sent to %email. <a href="@watchdog-url">Check the logs</a> for any error messages.', array(
       '%email' => $test_address,
