Ver Mensaje Individual
  #1 (permalink)  
Antiguo 02/02/2016, 10:27
blatehero
 
Fecha de Ingreso: noviembre-2014
Mensajes: 6
Antigüedad: 9 años, 5 meses
Puntos: 0
envio de mensajes phpmailer

buen dia llevo ya hace meses tratando de resolver este detalle, bueno estoy tratando de enviar un mensaje con la libreria phpMailer, pero no consigo que funcione, me sale el error

Warning: fsockopen(): in C:\xampp\htdocs\envioPlantilla\js\correo\class.smt p.php on line 122
Error SMTP: No puedo conectar al servidor SMTP.

les escribo el codigo, aver


<?php

include('js/correo/class.phpmailer.php');
include('js/correo/class.smtp.php');






$mail = new PHPMailer;
// $mail->SMTPDebug = 3;

$SPLangDir = "js/correo/language/";
$mail->SMTPDebug = 0;
$mail->SetLanguage("es", $SPLangDir);
$mail->isSMTP();
$mail->Host = 'smtp.gmail.com';
$mail->SMTPSecure = 'ssl';
$mail->SMTPAuth = true;
$mail->Username = 'email';
$mail->Password = 'pass';
// SMTP password
// $mail->Port = 587;
$mail->Port =465;

$mail->From = '[email protected]';
$mail->FromName = 'Test phpmailer';
$mail->addAddress('[email protected]');

$mail->isHTML(true);

$mail->Subject = 'Here is the subject';
$mail->Body = 'This is the HTML message body <b>in bold!</b>';
$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';

if(!$mail->send()) {

echo $mail->ErrorInfo;
} else {
echo 'Message has been sent';
}


?>