https://techandblogs.ml
acc: epiz_27647177
Error Message
Unable to send mails, says error 500
Other Information
<?php require_once 'mail/PHPMailer/PHPMailer/PHPMailerAutoload.php';
$servername = "sql212.epizy.com";
$username = "epiz_27647177";
$password = "HIDDEN BY MOD";
$dbname = "epiz_27647177_001";
$email = $_POST['email'];
// Create connection
$conn = mysqli_connect($servername, $username, $password, $dbname);
// Check connection
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
$sql = "INSERT INTO Email(EmailId)VALUES('$email')";
if (mysqli_query($conn, $sql)) {
echo "Mail Registered Successfully";
} else {
echo "Error: " . $sql . "<br>" . mysqli_error($conn);
}
mysqli_close($conn);
$mail = new PHPMailer;
echo '1'
$mail->CharSet = 'utf-8';
$mail->SMTPDebug = 2;
$mail->isSMTP();
$mail->Host = gethostbyname('smtp.gmail.com');
$mail->SMTPAuth = true;
$mail->Username = '[email protected]';
$mail->Password = 'HIDDEN BY MOD';
$mail->SMTPSecure = 'tls';
$mail->Port = 587;
echo '2'
$mail->setFrom('[email protected]');
$mail->addAddress($email);
$mail->isHTML(true);
$mail->Subject = 'You have successfully registered for weekly newsletters! techandblogs.ml';
$mail->AltBody = You have registerd your mail to recieve newsletters from techandblogs.ml;
if (!$mail->send()) {
echo 'Message could not be sent.';
echo 'Mailer Error: ' . $mail->ErrorInfo;
} else {
echo 'Check Mail';
}
echo '3'
?>
on execution, it says error 500 why.
I am using PHPMailer