diff --git a/wp-mail.php b/wp-mail.php index fe503d352..3e1551ce7 100644 --- a/wp-mail.php +++ b/wp-mail.php @@ -24,10 +24,10 @@ for ($i=1; $i <= $count; $i++) : $content = ''; $content_type = ''; + $content_transfer_encoding = ''; $boundary = ''; $bodysignal = 0; - $dmonths = array('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', - 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'); + $dmonths = array('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'); foreach ($message as $line) : if (strlen($line) < 3) $bodysignal = 1; @@ -40,6 +40,12 @@ for ($i=1; $i <= $count; $i++) : $content_type = explode(';', $content_type); $content_type = $content_type[0]; } + if (preg_match('/Content-Transfer-Encoding: /i', $line)) { + $content_transfer_encoding = trim($line); + $content_transfer_encoding = substr($content_transfer_encoding, 27, strlen($content_transfer_encoding)-14); + $content_transfer_encoding = explode(';', $content_transfer_encoding); + $content_transfer_encoding = $content_transfer_encoding[0]; + } if (($content_type == 'multipart/alternative') && (preg_match('/boundary="/', $line)) && ($boundary == '')) { $boundary = trim($line); $boundary = explode('"', $boundary); @@ -111,11 +117,16 @@ for ($i=1; $i <= $count; $i++) : $content = strip_tags($content[1], '
Content-type: $content_type, boundary: $boundary Content-type: $content_type, Content-Transfer-Encoding: $content_transfer_encoding, boundary: $boundary Raw content:".$content.'
';
$content = trim($content);
@@ -161,4 +172,4 @@ endfor;
$pop3->quit();
-?>
\ No newline at end of file
+?>