我有一个简单的脚本,可以使用PHPmail使用PHP发送邮件:
我在#8行中收到此错误syntax error, unexpected '='
。
请检查脚本:
<?php
require_once('phpmailer/class.phpmailer.php');
$mail = new PHPMailer();
$mail>IsSMTP();
$mail>SMTPAuth = true; // This is the line #8
$mail>SMTPSecure = "ssl";
$mail>Host = "smtp.gmail.com";
$mail>Port = 465;
$mail>Username = "email@gmail.com";
$mail>Password = "password";
$mail>SetFrom('email@gmail.com', 'Name');
$mail>AddReplyTo("email@gmail.com","Name");
$mail>Subject = "Using PHPmail with Gmail";
$mail>MsgHTML("Hi");
$address = "email@gmail.com";
$mail>AddAddress($address, "Name");
if(!$mail>Send()) {
echo "Error al enviar: " . $mail>ErrorInfo;
} else {
echo "Mensaje enviado!";
}
?>
错误与第8行之后的所有其他行相同。
错误是什么?
由于