0

为什么phpmailer会在远程服务器上发送带有空正文的电子邮件但在本地服务器上工作正常?

代码是一样的

    $res = $db->run("SELECT * FROM email WHERE code = 'welcome'");
    $m = $res[0];

    $body = nl2br($m['content']);
    $body = str_replace("[EMAIL]", $ld['email'], $body);
    $body = str_replace("[PASSWORD]", $ld['password'], $body);

    $mail = new PHPMailer();
    $mail->AddReplyTo($m['from_address'], $m['from_name']);
    $mail->AddAddress($ld['email'], "");
    $mail->SetFrom($m['from_address'], $m['from_name']);
    $mail->Subject = $m['subject'];
    $mail->AltBody = strip_tags($body);
    $mail->MsgHTML($body);
    if ($mail->Send() === false)
    {
        p($mail->ErrorInfo);
    }
    unset($mail);
4

1 回答 1

0

如果有人发现这个并且像我一样没有任何线索,phpmailer 5.2.6 的更新将解决这个问题。

于 2013-09-05T09:30:41.180 回答