mail() problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
harrisonad
Forum Contributor
Posts: 288
Joined: Fri Oct 15, 2004 4:58 am
Location: Philippines
Contact:

mail() problem

Post 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?
Simon
Forum Newbie
Posts: 12
Joined: Sun Dec 12, 2004 11:36 pm

Post 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 >
User avatar
harrisonad
Forum Contributor
Posts: 288
Joined: Fri Oct 15, 2004 4:58 am
Location: Philippines
Contact:

re

Post 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?
Simon
Forum Newbie
Posts: 12
Joined: Sun Dec 12, 2004 11:36 pm

Post 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 >
Post Reply