0

I have a simple script to send an mail with PHP using PHPmail:

I'm getting this error syntax error, unexpected '=' in the line #8.

Please check the script:

<?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!";
}

?>

The error is the same with all the other lines after line #8.

What's the error?

Thanks

araujophillips
  • 322
  • 1
  • 5
  • 22

0 Answers0