这是在bluehost上 - 我尝试过向gmail以外的其他客户端发送,我仍然遇到同样的问题:我的所有html都显示为纯文本/标签。没有渲染成html。
$to = '###@gmail.com';
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= "From: $from \r\n";
$headers = array(
'From' => "###@####.com",
'Cc' => "####@gmail.com",
'Subject' => "Your Reminder From Remindmeto.org",
);
$body = '<html><body>';
$body .= '<h1>From the mists of memory I speak...</h1>';
$body .= "$image";
$body .= '</body></html>';
$mail = Mail::factory("mail");
$mail->send($to, $headers, $body);
答案 0 :(得分:0)
您正在设置标题两次。改为:
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= "From: $from \r\n";
$headers .= "Cc: ####@gmail.com \r\n";
$headers .= "Subject: Your Reminder From Remindmeto.org \r\n";
摆脱阵列部分:)