SMTP connect () failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

0

I am trying to send an email using PHPMailer configured with the data of my corporate mail server and which I get the following error:

SMTP connect () failed.

I am trying to do it from a PC with windows server 2008 r2, I have tried the code on a PC with windows 10 and it runs well.

the code is:

$mail = new PHPMailer();
//Server settings
$mail->SMTPDebug = 2;                                 
$mail->isSMTP();                                      
$mail->Host = 'mail.empresa.com';  
$mail->SMTPAuth = true;                               
$mail->Username = '[email protected]';                 
$mail->Password = 'password';                           
$mail->SMTPSecure = 'tls';                            
$mail->Port = 587;                                    

//Recipients
$mail->setFrom('[email protected]', 'empresa name');
$mail->addAddress('[email protected]', 'destino name');     

//Content
$mail->isHTML(true);                                  
$mail->Subject = 'Reporte Compras Diarias';
$mail->Body    = $tabla_columnas;

$mail->send();
    
asked by joseyanez91 29.12.2018 в 17:36
source

0 answers