Pues eso, con mi servidor apache en localhost el spcript funciona perfectamente, pero desde el servidor nanai. Y nose porque.
Código:
session_start();
require('class.phpmailer.php');
$mail = new PHPMailer();
$mailCliente = new PHPMailer();
$mail->IsSMTP(); // send via SMTP
$mailCliente->IsSMTP(); // send via SMTP
$mail->Host = "smtpout.secureserver.net"; // SMTP servers
$mailCliente->Host = "smtpout.secureserver.net"; // SMTP servers
$mail->SMTPAuth = true; // turn on SMTP authentication
$mailCliente->SMTPAuth = true; // turn on SMTP authentication
$mail->Username = "[email protected]"; // SMTP username
$mailCliente->Username = "[email protected]"; // SMTP username
$mail->Password = "xxx"; // SMTP password
$mailCliente->Password = "xxx"; // SMTP password
$mail->From = "[email protected]";
$mail->FromName = "Cliente: " . $_POST["fnombre"] . " " . $_POST["fapellidos"];
$mail->AddAddress("[email protected]");
$mail->Subject = "Pedido del Cliente";
$mail->Body =
"<b></u>Información de pedido:</u></b><br/><br/>
<b>Nombre: </b>" . $_POST["fnombre"] .
"<br/><b>Apellidos: </b>" . $_POST["fapellidos"] .
"<br/><b>Email: </b>" . $_POST["femail"] .
"<br/><b>Telefono: </b>" . $_POST["ftelefono"] .
"<br/><b>Tipo: </b>" . $_POST["ftipo"] .
"<br/><b>Comentario: </b><br/>" . $_POST["fcomentario"];
$mail->AltBody = "This is the text-only body";
if(!$mail->Send()){
echo "xxx";
exit;
}
$mailCliente->From = "[email protected]";
$mailCliente->FromName = "xxx.xxx";
$mailCliente->AddAddress($_POST["femail"]);
$mailCliente->Subject = "Notificador xxx.xxx";
$mailCliente->Body =
"<p>La información de su pedido nos ha llegado correctamente, no obstante, por si pudiera existir algun error, aquí le enviamos una copia de los datos que nos ha facilitado.</p><br/>
<b>Nombre: </b>" . $_POST["fnombre"] .
"<br/><b>Apellidos: </b>" . $_POST["fapellidos"] .
"<br/><b>Email: </b>" . $_POST["femail"] .
"<br/><b>Telefono: </b>" . $_POST["ftelefono"] .
"<br/><b>Tipo: </b>" . $_POST["ftipo"] .
"<br/><b>Comentario: </b><br/>" . $_POST["fcomentario"];
$mailCliente->AltBody = "This is the text-only body";
if(!$mailCliente->Send()){
echo "No se le ha podido enviar un email con la notificación de su pedido.";
exit;
}
echo "asdasdas";
?>
Y me suelta el siguiente error:
"SMTP Error: Could not connect to SMTP host."
¿A que se puede deber que el mismo script me funcione en localhost y en el servidor de goddady no?, muchas gracias.