Index: trunk/core/kernel/utility/email.php =================================================================== diff -u -r5248 -r5431 --- trunk/core/kernel/utility/email.php (.../email.php) (revision 5248) +++ trunk/core/kernel/utility/email.php (.../email.php) (revision 5431) @@ -136,8 +136,10 @@ $this->Compiled = false; } - function compileBody(){ - $search = array ( + + function convertHTMLtoPlain($text) + { + $search = Array ( "'(<\/td>.*)[\r\n]+(.*)|(<\/p>)|(<\/div>)|(<\/tr>)'i", "'(.*?)'si", @@ -158,7 +160,7 @@ "'&#(\d+);'e" ); - $replace = array ( + $replace = Array ( "\\1\t\\2", "\n", "", @@ -178,11 +180,14 @@ chr(169), "chr(\\1)" ); + return strip_tags( preg_replace ($search, $replace, $text) ); + } + + function compileBody(){ + if($this->BodyHtml){ - - - $not_html = preg_replace ($search, $replace, $this->BodyHtml); - $not_html = strip_tags($not_html); + $not_html = $this->convertHTMLtoPlain($this->BodyHtml); + // $not_html = $this->removeBlankLines($not_html); // Fixing problem with add exclamation characters "!" into the body of the email. $not_html = wordwrap($not_html, 72); @@ -212,8 +217,7 @@ $this->IsMultipart = true; }else{ - $not_html = preg_replace ($search, $replace, $this->BodyText); - $not_html = strip_tags($not_html); + $not_html = $this->convertHTMLtoPlain($this->BodyText); // $not_html = $this->removeBlankLines($not_html); // Fixing problem with add exclamation characters "!" into the body of the email. $not_html = wordwrap($not_html, 72);