我无法使用PHPMailer发送邮件

This is my index.php file

Please suggest what is wrong with the below code that i am not receiving mails or if there is any other easy way of sending emails.

<?php

$mail = new PHPMailer;
$mail->isSMTP();
$mail->SMTPAuth=false;
$mail->SMTPSecure='tls';
$mail->Host='smtp.gmail.com';
$mail->port='587';
$mail->isHTML();
$mail->Username='demoXXXXX@gmail.com';
$mail->Password='XXXXXX';
$mail->SetFrom('no-reply@gmail.com');


$mail->Subject = "Subject Text";
$mail->Body = "<i>Mail body in HTML</i>";


$mail->addAddress("parkingston@gmail.com");

if(!$mail->send()) 
{
    echo "Mailer Error: " . $mail->ErrorInfo;
} 
else 
{
    echo "Message has been sent successfully";
}

?>     

Include class.phpmailer.php & classes/class.smtp.php first .

 <?php
    require "autoload.php";
    include "class.phpmailer.php"; // include the class name
    include "class.smtp.php";

    $mail = new PHPMailer;
    $mail->isSMTP();
    $mail->SMTPAuth=false;
    $mail->SMTPSecure='tls';
    $mail->Host='smtp.gmail.com';
    $mail->port='587';
    $mail->isHTML();
    $mail->Username='demoXXXXX@gmail.com';
    $mail->Password='XXXXXX';
    $mail->SetFrom('no-reply@gmail.com');


    $mail->Subject = "Subject Text";
    $mail->Body = "<i>Mail body in HTML</i>";


    $mail->addAddress("parkingston@gmail.com");

    if(!$mail->send()) 
    {
        echo "Mailer Error: " . $mail->ErrorInfo;
    } 
    else 
    {
        echo "Message has been sent successfully";
    }

    ?>   

You can easily download this both file if you do not have it. Hope it will help you.