Error: SMTP NOTICE: EOF caught while checking if connected SMTP connect() failed. Mailer Error: SMTP connect() failed.
<?php
require('class.phpmailer.php');
$mail = new PHPMailer();// create a new object
$mail ->IsSMTP(); // enable SMTP
$mail ->SMTPDebug = 1; // debugg ing: 1 = errors and messages, 2 = messages only $mail->SMTPAuth = true; // authentication enabled
$mail->SMTPSecure = 'ssl'; // secure transfer enabled REQUIRED for GMail
$mail->Host = "smtp.gmail.com";
$mail->Port = 587; // or 465
$mail->IsHTML(true);
$mail->Username = "biz.online321@gmail.com";
$mail->Password = "mudunuru%^&";
$mail->SetFrom("example@gmail.com");
$mail->Subject = "Test";
$mail->Body = "hello";
$mail->AddAddress("varma.sfi123@gmail.com");
if(!$mail->Send())
{
echo "Mailer Error: " . $mail->ErrorInfo;
}
else
{
echo "Message has been sent";
}
?>
Your help will be appericiated