diff --git mimemail.inc mimemail.inc
index 387ac80..f824b8a 100644
--- mimemail.inc
+++ mimemail.inc
@@ -311,13 +311,9 @@ function _mimemail_expand_links($matches) {
  * image/attachment
  */
 function mimemail_html_body($body, $subject, $plaintext = FALSE, $text = NULL, $attachments = array()) {
-  if (empty($text)) {
-    // todo: remove this preg_replace once filter_xss() is properly handling
-    // direct descendant css selectors '>' in inline CSS. For now this cleans
-    // up our plain text part. See mimemail #364198, drupal #370903
-    $text = preg_replace('|<style.*?</style>|mis', '', $body);
-    $text = drupal_html_to_text($text);
-  }
+
+  $text = empty($text) ? mimemail_strip_html_tags($body) : $text; 
+
   if ($plaintext) {
     //Plain mail without attachment
     if (empty($attachments)) {
@@ -635,3 +631,49 @@ function mimemail_address($address) {
 
   return FALSE;
 }
+
+/**
+ * Remove HTML tags, including invisible text such as style and
+ * script code, and embedded objects.  Add line breaks around
+ * block-level tags to prevent word joining after tag removal.
+ * This function was taken from:
+ * http://nadeausoftware.com/articles/2007/09/php_tip_how_strip_html_tags_web_page
+ */
+function mimemail_strip_html_tags($text) {
+  
+  // we extract the body first.
+  $regexp = '|<body[^>]*>(.*?)</body|mis';
+  preg_match($regexp, $text, $matches);
+  
+  $body = $matches[1];
+  
+  $body = preg_replace(
+    array(
+          // Remove invisible content
+            '@<head[^>]*?>.*?</head>@siu',
+            '@<style[^>]*?>.*?</style>@siu',
+            '@<script[^>]*?.*?</script>@siu',
+            '@<object[^>]*?.*?</object>@siu',
+            '@<embed[^>]*?.*?</embed>@siu',
+            '@<applet[^>]*?.*?</applet>@siu',
+            '@<noframes[^>]*?.*?</noframes>@siu',
+            '@<noscript[^>]*?.*?</noscript>@siu',
+            '@<noembed[^>]*?.*?</noembed>@siu',
+          // Add line breaks before and after blocks
+            '@</?((address)|(blockquote)|(center)|(del))@iu',
+            '@</?((div)|(h[1-9])|(ins)|(isindex)|(p)|(pre))@iu',
+            '@</?((dir)|(dl)|(dt)|(dd)|(li)|(menu)|(ol)|(ul))@iu',
+            '@</?((table)|(th)|(td)|(caption))@iu',
+            '@</?((form)|(button)|(fieldset)|(legend)|(input))@iu',
+            '@</?((label)|(select)|(optgroup)|(option)|(textarea))@iu',
+            '@</?((frameset)|(frame)|(iframe))@iu',
+    ),
+    array(
+      ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',
+      "\n\$0", "\n\$0", "\n\$0", "\n\$0", "\n\$0", "\n\$0",
+      "\n\$0", "\n\$0",
+    ),
+    $body
+  );
+  return strip_tags($body);
+}
diff --git mimemail.module mimemail.module
index 91e5929..e356e09 100644
--- mimemail.module
+++ mimemail.module
@@ -395,8 +395,10 @@ if (strpos(variable_get('smtp_library', ''), 'mimemail') !== FALSE
       $body = $message['body'];
     }
     $headers = isset($message['headers']) ? $message['headers'] : array();
+    $plaintext = isset($message['plaintext']) ? $message['plaintext'] : NULL;
+    $text =  isset($message['text']) ? $message['text'] : NULL;
     $attachments = isset($message['attachments']) ? $message['attachments'] : array();
     $mailkey = isset($message['id']) ? $message['id'] : '';
-    return mimemail($from, $to, $subject, $body, NULL, $headers, NULL, $attachments, $mailkey);
+    return mimemail($from, $to, $subject, $body, $plaintext, $headers, $text, $attachments, $mailkey);
   }
 }
