diff --git a/smtp.mail.inc b/smtp.mail.inc
index b220eeb..80701ac 100644
--- a/smtp.mail.inc
+++ b/smtp.mail.inc
@@ -387,6 +387,21 @@ class SmtpMailSystem implements MailSystemInterface {
                   // Ensure the whole message is recoded in the base64 format.
                   $mailer->Encoding = 'base64';
                 }
+                // Temporary condition to find out why there may be whitespace
+                // on the encoding.
+                elseif (trim(drupal_strtolower($body_part2_encoding)) == 'base64') {
+                  // Collect details on what's happening here.
+                  $backtrace = debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT | DEBUG_BACKTRACE_IGNORE_ARGS);
+                  $watchdog_variables = array(
+                    '@encoding' => $body_part2_encoding,
+                    '@backtrace' => json_encode($backtrace, JSON_PRETTY_PRINT),
+                  );
+                  watchdog('smtp', 'Whitespace on base64 encoding "@encoding" <pre>@backtrace</pre>', $watchdog_variables, WATCHDOG_INFO);
+                  // Include it as part of the mail object.
+                  $mailer->Body = base64_decode($body_part2);
+                  // Ensure the whole message is recoded in the base64 format.
+                  $mailer->Encoding = 'base64';
+                }
                 else {
                   // Include it as part of the mail object.
                   $mailer->Body = $body_part2;
