PHPMailer SMTP ОШИБКА: не удалось подключиться к серверу

<?php

include("class.phpmailer.php");
include("class.smtp.php");

$mail = new PHPMailer();

$mail->IsSMTP();  // telling the class to use SMTP
$mail->Mailer = "smtp";
$mail->SMTPDebug = 2;
$mail->Host = "ssl://smtp.gmail.com"; // specify main and backup server
$mail->Port = 587; // set the port to use
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->SMTPSecure = "tls";

$mail->Username = "[email protected]"; // SMTP username
$mail->Password = "password"; // SMTP password 

$mail->From = "[email protected]";
$mail->FromName = "Webmaster";

$mail->AddAddress("[email protected]");
$mail->AddReplyTo("[email protected]", "Webmaster");
$mail->IsHTML(true);

$mail->Subject  = "First PHPMailer Message";
$mail->Body     = "Hi! \n\n This is my first e-mail sent through PHPMailer.";
$mail->WordWrap = 50;

if(!$mail->Send()) {
  echo 'Message was not sent.';
  echo 'Mailer error: ' . $mail->ErrorInfo;
} else {
  echo 'Message has been sent.';
}
?>

Возвращает ошибку

2016-04-01 08:41:43 SMTP ERROR: Failed to connect to server: (0) 
2016-04-01 08:41:43 SMTP connect() failed. 

https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting Message was not sent.Mailer error: SMTP connect() failed. 

https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

Я размещаю этот php на моем локальном сервере xampp.extension=php_openssl.dll наphp.ini уже рекомендуется.

Ответы на вопрос(1)

Ваш ответ на вопрос