SMTP server error: Authentication required

I am a new one for amazon Ec2 instance.Now I want to send mail to client using php code.I installed wamp in my amazon ec2 instance and run these file.

        use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;

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

        //SMTP Settings
        $mail = new PHPMailer();
        $mail->SMTPAuth   = true; 
        $mail->SMTPSecure = "tls"; 
        $mail->Host       = "";
        $mail->Port = 25;
        $mail->Username   = "";
        $mail->Password   = "*******";

        $mail->SetFrom('', 'Example'); //from (verified email address)
        $mail->Subject = "Email Subject"; //subject

        $body = "This is a test message.";
        $body = eregi_replace("[\]",'',$body);

        $mail->AddAddress("", "Myname"); 

        if ($mail->Send()) { 
            echo "Message sent!"; die; 

        if(!$mail->Send()) { 
            echo "Mailer Error: " . $mail->ErrorInfo; 


When run these file and I got some error.

Parse error: parse error in C:\wamp\www\samplemail\src\PHPMailer.php on line 304