Warning: fsockopen(): unable to connect to mailhost.terra.es:25 in c:\php\includes\class.smtp.php on line 105
Message could not be sent.
Mailer Error: Language string failed to load: connect_host
¿Alguien puede ayudarme?
Código PHP:
<?php
require("class.phpmailer.php");
$mail = new PHPMailer();
$mail->IsSMTP(); // set mailer to use SMTP
$mail->Host = "mailhost.terra.es"; // specify main and backup server
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Username = "usuario.terra.es"; // SMTP username
$mail->Password = "mipass"; // SMTP password
$mail->From = "[email protected]";
$mail->FromName = "Mailer";
$mail->AddAddress("[email protected]", "usuario");
$mail->AddReplyTo("[email protected]", "Informacion");
$mail->WordWrap = 50; // set word wrap to 50 characters
$mail->AddAttachment("c:/wwwroot/upload/imagen.jpg", "imagen.jpg"); // optional name
$mail->IsHTML(true); // set email format to HTML
$mail->Subject = "imagen";
$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 "Message could not be sent. <p>";
echo "Mailer Error: " . $mail->ErrorInfo;
exit;
}
echo "Message has been sent";
?>