diff --git a/smtp.module b/smtp.module
index fecf527..1de9465 100644
--- a/smtp.module
+++ b/smtp.module
@@ -659,7 +659,45 @@ function smtp_drupal_mail_wrapper($message) {
         // If test/plain within the body part, add it to either
         // $mail->AltBody or $mail->Body, depending on whether there is
         // also a text/html part ot not.
-        if (strpos($body_part, 'multipart/alternative')) {
+        if (strpos($body_part, 'multipart/related')) {
+          // Clean up the text.
+          $body_part = trim(_smtp_remove_headers(trim($body_part)));
+          // Get boundary ID from the Content-Type header.
+          $boundary2 = _smtp_get_substring($body_part, 'boundary', '"', '"');
+          // Split the body based on the boundary ID.
+          $body_parts2 = _smtp_boundary_split($body_part, $boundary2);
+
+          foreach ($body_parts2 as $body_part) {
+            if (strpos($body_part, 'multipart/alternative')) {
+              // Clean up the text.
+              $body_part = trim(_smtp_remove_headers(trim($body_part)));
+              // Get boundary ID from the Content-Type header.
+              $boundary3 = _smtp_get_substring($body_part, 'boundary', '"', '"');
+              // Split the body based on the boundary ID.
+              $body_parts3 = _smtp_boundary_split($body_part, $boundary3);
+
+              foreach ($body_parts3 as $body_part3) {
+                // If plain/text within the body part, add it to $mail->AltBody.
+                if (strpos($body_part3, 'text/plain')) {
+                  // Clean up the text.
+                  $body_part3 = trim(_smtp_remove_headers(trim($body_part3)));
+                  // Include it as part of the mail object.
+                  $mail->AltBody = $body_part3;
+                  $mail->ContentType = 'multipart/mixed';
+                }
+                // If plain/html within the body part, add it to $mail->Body.
+                elseif (strpos($body_part3, 'text/html')) {
+                  // Clean up the text.
+                  $body_part3 = trim(_smtp_remove_headers(trim($body_part3)));
+                  // Include it as part of the mail object.
+                  $mail->Body = $body_part3;
+                  $mail->ContentType = 'multipart/mixed';
+                }
+              }
+            }
+          }
+        }
+        elseif (strpos($body_part, 'multipart/alternative')) {
           // Clean up the text.
           $body_part = trim(_smtp_remove_headers(trim($body_part)));
           // Get boundary ID from the Content-Type header.
@@ -699,7 +737,7 @@ function smtp_drupal_mail_wrapper($message) {
           else {
             $mail->Body = $body_part;
             $mail->IsHTML(FALSE);
-            $mail->ContentType = 'multipart/mixed';
+            $mail->ContentType = 'text/plain';
           }
         }
         // If text/html within the body part, add it to $mail->Body.
@@ -753,7 +791,6 @@ function smtp_drupal_mail_wrapper($message) {
       break;
   }
 
-
   // Set the authentication settings.
   $username = variable_get('smtp_username', '');
   $password = variable_get('smtp_password', '');
