我试图让PHP邮件程序工作。我收到一个错误,但无法从Google上找到任何信息。PHP,PHPMailer:无法获取PHPMailer的示例代码来工作
$mail = new phpmailer;
$mail->IsSMTP(); // set mailer to use SMTP
$mail->SMTPSecure = "ssl";
$mail->Host = "smtp.gmail.com";
$mail->Port = 465;
$mail->From = "[email protected]";
$mail->FromName = "Mailer";
$mail->AddAddress("[email protected]", "User");
//$mail->AddAddress("[email protected]"); // name is optional
$mail->AddReplyTo("[email protected]", "Information");
$mail->WordWrap = 50; // set word wrap
//$mail->AddAttachment("c:\\temp\\js-bak.sql"); // add attachments
//$mail->AddAttachment("c:/temp/11-10-00.zip");
$mail->IsHTML(true); // set email format to HTML
$mail->Subject = "Here is the subject";
$mail->Body = "This is the message body";
$mail->Send(); // send message
上面的代码是我使用的是什么,但是当我尝试运行它,我得到我的浏览器下...
Fatal error: Cannot access empty property in /the/full/path/to/phpmailer.inc.php on line 271
这里是它指的是行...
$header[] = sprintf("Content-Transfer-Encoding: %s\n", $this->$Encoding);
如果有人能帮助它将不胜感激!谢谢。
你检查了`$ this-> Encoding`吗?我不认为`Encoding`是一个变量。 – Ben 2011-01-11 01:15:25