发送空体电子邮件

时间:2013-09-05 09:10:50

标签: php phpmailer

有什么理由说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);

1 个答案:

答案 0 :(得分:0)

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