Page 1 of 1

mail() problem

Posted: Mon Dec 13, 2004 12:07 am
by harrisonad
hello,

i just got this while attempting to send mail using mail() function:

Warning: mail(): Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\WebShare\wwwroot\intranet\viva\db\updatedb.php on line 45

What could have been causing this one?

Posted: Mon Dec 13, 2004 12:15 am
by Simon
Sounds like you're using PHP on a Windows machine. If so, PHP actually needs to send mail using an SMTP server which you specify in PHP.INI. At the moment, PHP can't connect to the SMTP server because you're probably not running one on "localhost". Perhaps specify your ISP's SMTP server for it to use.

< Simon >

re

Posted: Mon Dec 13, 2004 12:46 am
by harrisonad
you know guys, my script is behind a company firewall and i believe it is the one causing the error.

i asked our system admin but he didn't know how to resolve it

any ideas?

Posted: Mon Dec 13, 2004 2:17 am
by Simon
I don't think it's a firewall issue, because your webserver is trying to connect to an SMTP server on the same machine - a firewall probably isn't even involved at that point. You need to give PHP a different address of a server that can send mail for you.

< Simon >