Hello everyone, I have a problem that according to the library's documentation my code is fine
require_once '../lib/PHPMailer/PHPMailerAutoload.php';
require_once '../autoloadIn.php';
$cadena = "<p style='display:block;color:red;font:bold;'>Gracias por el CRM<p/>";
$reporte = ComercialDO::listar_indicardor();
$mail = New PHPMailer;
$mail->isSMTP();
$mail->SMTPDebug = 4;
$mail->Debugoutput = 'html';
$mail->SMTPAuth = TRUE;
$mail->SMTPSecure = 'tls';
$mail->Host = 'smtp.gmail.com';
$mail->Port = 587;
$mail->Username = '[email protected]';
$mail->Password = 'xxxxxxx';
$mail->setFrom('[email protected]','Administrador CRM');
$mail->addAddress('[email protected]');
$mail->Subject = 'Prueba Reporte';
$mail->msgHTML($cadena.$reporte);
if (!$mail->send()) {
echo "Erro".$mail->ErrorInfo;
} else {
echo "Mensaje Enviado";
}
When I run it, it shows me this error
Connection: opening to smtp.gmail.com:587, timeout = 300, options = array () SMTP ERROR: Failed to connect to server: php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution (0) SMTP connect () failed. link ErroSMTP connect () failed. link
As I saw your documentation of the error everything is fine but I do not know where I am doing wrong or maybe I am missing something Thanks for the help:)