HTML Email fails to display in Entourage 2008
When using PEAR Mail using SMTP there is an error created by these lines of code in PEAR_MAIL_Using_SMTP.php
switch ($mailObj->BodyFormat) {
case 1:
$headerArray["Content-Type"] = "text/plain".(($mailObj->CharSet != "")?"; charset=\"".preg_replace("/[\r\n]/", "", $mailObj->CharSet):"").'"';
break;
case 0:
$headerArray["Content-Type"] = "text/html".(($mailObj->CharSet != "")?"; charset=\"".preg_replace("/[\r\n]/", "", $mailObj->CharSet):"").'"';
break;
}
which creates an error in the email header by leaving an extraneous double quote like so
MIME-Version: 1.0
Content-Type: text/html"
which causes the email to display only the html code as text it displays fine in Mac Mail as this seems to be more forgiving of these errors.
To solve this I changed the offending lines of code as follows:
switch ($mailObj->BodyFormat) {
case 1:
$headerArray["Content-Type"] = "text/plain".(($mailObj->CharSet != "")?"; charset=".preg_replace("/[\r\n]/", "", $mailObj->CharSet):"");
break;
case 0:
$headerArray["Content-Type"] = "text/html".(($mailObj->CharSet != "")?"; charset=".preg_replace("/[\r\n]/", "", $mailObj->CharSet):"");
break;
}
and now the email displays just fine.
Using Universal Email 3.0.6 on CS4 on OSX Leopard with all the latest updates applied.