<?php
// Mail Sent Tested Ok//
include'connection.php';
include'time.php';
$from="info@llprecharge.in";

//$uid=500012;
$to="sameermansuri111@gmail.com";
$subject="Test_Insert";
$Mmsg="Insert Or Not";

  require("PHPMailer-master/src/PHPMailer.php");
  require("PHPMailer-master/src/Exception.php");
  require("PHPMailer-master/src/SMTP.php");

    $mail = new PHPMailer\PHPMailer\PHPMailer();
    $mail->IsSMTP(); // enable SMTP

    //$mail->SMTPDebug = 2; // debugging: 1 = errors and messages, 2 = messages only
    $mail->SMTPAuth = true; // authentication enabled
    //$mail->SMTPSecure = 'ssl'; // secure transfer enabled REQUIRED for Gmail
    $mail->Host = "llprecharge.in";
    $mail->Port = 587; // or 587
    $mail->IsHTML(true);
    $mail->Username = "info@llprecharge.in";
    $mail->Password = "Password@9897095971";
    $mail->SetFrom($from);
    $mail->FromName= "LLP RECHARGE";
    $mail->Subject = $subject;
    $mail->Body = $Mmsg;
    $mail->AddAddress($to);
    $mail->AddCC($ToCcMail);

     if(!$mail->Send())
     {
        echo "<center><h3 style='color:red;'>Mail Not sent !" . $mail->ErrorInfo . "</h3></center><br>";
     }
     else
     {
        $insertMail="insert into mail(Date,Time,Userid,FromMailId,ToMailId,Subject,Msg) values('$date','$time','$uid','$from','$to','$subject','$Mmsg')";
        if(mysqli_query($con,$insertMail))
        {
            echo "<center><h3 style='color:green;'>Mail has been sent and insert Successfully!</h3></center><br>";
        }
     }
?>