I am using PHPMailer for sending email to the customer. Yesterday, It was working but from today morning It's not working. I am getting "Message sent" also getting some information but I am not getting the email.
Would you help me out in this?
Thanks in advance!
2018-03-04 06:49:12 CLIENT -> SERVER: EHLO test.com 2018-03-04 06:49:12 CLIENT -> SERVER: STARTTLS 2018-03-04 06:49:12 CLIENT -> SERVER: EHLO test.com 2018-03-04 06:49:12 CLIENT -> SERVER: AUTH LOGIN 2018-03-04 06:49:12 CLIENT -> SERVER: bm8tcmVwbHlAYnV5YnJhbmRlZHZpYWdyYS5jb20= 2018-03-04 06:49:12 CLIENT -> SERVER: UGFzcyNAMTIz 2018-03-04 06:49:12 CLIENT -> SERVER: MAIL FROM: 2018-03-04 06:49:12 CLIENT -> SERVER: RCPT TO: 2018-03-04 06:49:12 CLIENT -> SERVER: DATA 2018-03-04 06:49:12 CLIENT -> SERVER: Date: Sun, 4 Mar 2018 06:49:12 +0000 2018-03-04 06:49:12 CLIENT -> SERVER: To: test@gmail.com 2018-03-04 06:49:12 CLIENT -> SERVER: From: test_site 2018-03-04 06:49:12 CLIENT -> SERVER: Subject: test 2018-03-04 06:49:12 CLIENT -> SERVER: Message-ID: 2018-03-04 06:49:12 CLIENT -> SERVER: X-Priority: 3 2018-03-04 06:49:12 CLIENT -> SERVER: X-Mailer: PHPMailer 5.2.9 (https://github.com/PHPMailer/PHPMailer/) 2018-03-04 06:49:12 CLIENT -> SERVER: MIME-Version: 1.0 2018-03-04 06:49:12 CLIENT -> SERVER: Content-Type: text/html; charset=UTF-8 2018-03-04 06:49:12 CLIENT -> SERVER: Content-Transfer-Encoding: 8bit 2018-03-04 06:49:12 CLIENT -> SERVER: 2018-03-04 06:49:12 CLIENT -> SERVER: Test 2018-03-04 06:49:12 CLIENT -> SERVER: 2018-03-04 06:49:12 CLIENT -> SERVER: . 2018-03-04 06:49:12 CLIENT -> SERVER: QUIT Message sent!
index.php
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<form action="test2.php" method="post" enctype="multipart/form-data">
<input type="email" name="email" placeholder="email">
<input type="submit" name="submit" value="submit">
</form>
</body>
</html>
test2.php
<?php
require_once('mail/class.phpmailer.php');
require_once('mail/PHPMailerAutoload.php');
$servername = "localhost";
$username = "username";
$password = "Pass#@123";
$dbname = "db";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$conn->set_charset('utf8');
if (isset($_POST['submit'])) {
$email=$conn->real_escape_string(trim($_POST['email']));
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->SMTPDebug = 1; // debugging: 1 = errors and messages, 2 = messages only
$mail->SMTPAuth = true;
$mail->CharSet="UTF-8";
$mail->SMTPSecure = 'tls';
$mail->Host = 'md-**-**.****.***';//server name
$mail->Port = 587;
$mail->IsHTML(true);
$mail->Username = 'no-reply@test.com';
$mail->Password = 'Pass#@123';
//$mail->SetFrom('no-reply@test.com');
$mail->From = 'no-reply@test.com';
$mail->FromName = "test";
$mail->AddAddress($email);//user email
//$mail->AddReplyTo('*****@gmail.com', 'Information');
$mail->Subject = "test";
$mail->AltBody = "";
$mail->Body = "Test";
if(!$mail->Send())
{
echo "Mailer Error: " . $mail->ErrorInfo;
}
else
{
echo "Message sent!";
}
}
?>