当我尝试使用的PHPMailer类我得到这个错误发送电子邮件: 梅勒错误:邮件正文为空:PHP梅勒类问题:邮件正文空
<?php
include("class.phpmailer.php");
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->SMTPAuth = true;
$mail->SMTPSecure = "ssl";
$mail->Host = "rsb20.rhostbh.com";
$mail->Port = 465;
$mail->Username = "jobserreker+furrtexlab.com";
$mail->Password = "12345678a";
$mail->From = "[email protected]";
$mail->FromName = "Job Seeker";
$mail->Subject = $_GET['subject'];
$mail->MsgHTML($_GET['msg']);
$mail->AddAddress($_GET['to'],"name to");
$mail->IsHTML(false);
if(!$mail->Send())
{
echo "Mailer Error: " . $mail->ErrorInfo;
}else{
echo "Message sent!";
}
?>
任何机会$ _GET ['msg']为空? – unfrev 2012-07-16 14:45:29
如果您使用$ mail-> MsgHTML($ _ GET ['msg']);但接着说$ mail-> IsHTML(false);你是不是应该使用其他属性来设置文本?像Body这样的属性?或者也许$ _GET ['msg']是空的? – 2012-07-16 14:46:20
你可以请'回声'--->'。 $ _GET ['msg']。 '<---',为了检查'$ _GET ['msg']'的内容? – fsenart 2012-07-16 14:47:51