This is the Code , its working on local host but not working on live server
isSMTP();
i already remove it on live server but still dosent work
<?php
use PHPMailer\PHPMailer\PHPMailer;
require 'PHPMailer/src/Exception.php';
require 'PHPMailer/src/PHPMailer.php';
require 'PHPMailer/src/SMTP.php';
//Create an instance; passing `true` enables exceptions
$mail = new PHPMailer(true);
$alert = "";
if(isset($_POST['submitit'])){
$name = $_POST['name'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$subject = $_POST['subject'];
$message = $_POST['message'];
try {
// $mail->isSMTP();
$mail->Host = 'mrcreativeproductions.com';
$mail->SMTPAuth = true;
$mail->Username = 'mrcreativeproductions1@gmail.com';
$mail->Password = 'jhmsxriwesuqbpnk';
// $mail->SMTPSecure = PHPMailer::ENCRYPTION_SMTPS;
$mail->SMTPSecure = "tls";
$mail->Port = 587;
$mail->setFrom('wilfredpeace715@gmail.com');
$mail->addAddress('mrcreativeproductions1@gmail.com'); //Add a recipient
$mail->isHTML(true);
$mail->Subject = 'message received from contact:'. $name;
$mail->Body = "Name: $name <br> Phone: $phone <br> Email: $email <br> Message: $message";
$mail->send();
$alert = "<div class='alert-success'><span>Message Sent! thnx</span></div>";
// $mail->addReplyTo('info@example.com', 'Information');
// $mail->addCC('cc@example.com');
// $mail->addBCC('bcc@example.com');
//Recipients
} catch (Exception $e) {
$alert = "<div class='alert-error'><span>'.$e->getMessage().'</span></div>";
}
}
?>