SMTP -> ERROR: Failed to connect to server: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. (10060) The following From address failed:id@gmail.com : Called Mail() without being connected Mailer Error: The following From address failed: id@gmail.com : Called Mail() without being connected
I am not able to send email I get the above error. Here`s the code
<?php require_once("Project/function/PHPMailer/class.phpmailer.php");
$mail = new PHPMailer(); // create a new object
$mail->IsSMTP(); // enable SMTP
$mail->SMTPDebug = 1; // debugging: 1 = errors and messages, 2 = messages only
$mail->SMTPAuth = true; // authentication enabled
$mail->SMTPSecure = 'ssl'; // secure transfer enabled REQUIRED for GMail
$mail->Host = "ssl://smtp.gmail.com";
$mail->Port = 465; // or 587
$mail->IsHTML(true);
$mail->Username = "id@gmail.com";
$mail->Password = "password";
$mail->SetFrom("id@gmail.com");
$mail->Subject = "Test";
$mail->MsgHTML("Hello World");
$mail->AddAddress("id@gmail.com");
if(!$mail->Send()){
echo "Mailer Error: " . $mail->ErrorInfo;
}
else{
echo "Message has been sent";
}
?>
I am using wamp ver 2.4. The wamp server is offline.The Open SSL extension is enabled have checked the php.ini file the ; has been removed from open ssl dll.
Is using PEAR better?