Ver Mensaje Individual
  #1 (permalink)  
Antiguo 07/09/2003, 06:19
JCGX
 
Fecha de Ingreso: julio-2003
Mensajes: 12
Antigüedad: 20 años, 9 meses
Puntos: 0
phpmailer error

Bien, este es el codigo de un script que me saque del readme del phpmailer (adaptado). Y me da los siguientes errores:

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";
?>
GRACIAS