0

这是在 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);
4

1 回答 1

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";

并摆脱数组部分:)

于 2012-09-03T01:36:33.410 回答