PHP Mailer 'PHP Parse error'

0

When using PHP Mailer it is returning the following message to me

  

PHP Parse error: syntax error, unexpected '[' in plugins \ PHPMailer \ src \ PHPMailer.php on   line 288

My code as below

require 'plugins/PHPMailer/src/Exception.php';
require 'plugins/PHPMailer/src/PHPMailer.php';
require 'plugins/PHPMailer/src/SMTP.php';

$email = new PHPMailer();
$email->From      = '[email protected]';
$email->FromName  = 'Seu nome';
$email->Subject   = 'Assunto';
$email->Body      = 'Teste';
$email->AddAddress( '[email protected]' );

$file_to_attach = 'teste';
$email->AddAttachment( $file_to_attach , 'teste.pdf' );

$email->Send();

Downloaded at link

What is the reason for the error?

    
asked by anonymous 06.02.2018 / 01:35

0 answers