My mailing php script gives the following output. Please can anyone
suggest what is missing?
....
Warning: fsockopen(): unable to connect to mail.xxxxxxxxxx.com:25 in
/pear/lib/class.smtp.php on line 105 SMTP -> ERROR: Failed to connect to
server: Operation timed out (60) Message could not be sent.
Mailer Error: Language string failed to load: connect_host
....
my mailing script is as follows..
<?php
require("class.phpmailer.php");
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->SMTPDebug = true;
$mail->Host = "mail.xxxxxxxxx.com";
$mail->SetLanguage("en");
$mail->From = "te...@xxxxxxxxx.com";
$mail->FromName = "Mailer";
$mail->AddAddress("te...@xxxxxxxx.com", "Test");
$mail->AddReplyTo("in...@example.com", "Information");
$mail->WordWrap = 50;
$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 "Message could not be sent. <p>";
echo "Mailer Error: " . $mail->ErrorInfo;
exit;
}
echo "Message has been sent";
?>
xxxxxxxxx to protect the guilty :)
thanks
Gary
Sean
Create /var/www/etc/resolv.conf and put the IP of your favourite DNS Server
in.
I'm not sure be it could be that.
I hope it could help you,
++ Jerome
> -----Message d'origine-----
> De : owner...@openbsd.org [mailto:owner...@openbsd.org] De la part de
> Gary Clemans-Gibbon
> Envoyé : mardi 26 octobre 2004 22:02
> À : mi...@openbsd.org
> Objet : Sending mail from php
# telnet localhost 25
telnet: localhost: no address associated with name
localhost: No address associated with name
telnet 127.0.0.1 25 gives the same result but telnet mail.xxxxxxx.com
25 works.
I think the hosts file is doing it's job though because when I run the
following php script I get 127.0.0.1 as the output in the browser..
<?php
$ip = gethostbyname('mail.xxxxxxxxx.com');
echo $ip;
?>
thanks
Gary
On Tue, 26 Oct 2004 13:43:15 -0700
Sean <se...@obstacle9.com> wrote:
> For whatever reason, you couldn't connect to the destination mail
> server. Try confirming that it's actually accessible by telneting to
> mail.xxxxxxx.com:25 from your PHP box.
>
> Sean
>
>
> Gary Clemans-Gibbon wrote:
--
regards
Gary
"The cosmos is all it is, all it ever was and all it ever will be" -
Carl Sagan