Failed to connect to mailserver

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I am running IIS5 on my XP Pro home computer and am unable to send
email through my ISP's mail server. In the PHP.INI are two lines:

smtp =
smtp_port = 25

I have opened port 25 on my own computer (do I need to though?) and I
am able to telnet to the ISP's SMTP server. When I try to send an email
from my PHP page I get the well-known error message:

Warning: mail() [function.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 [filename] on line 40.

The strange thing is, the mail() function seems to be trying to connect
to "localhost" and not "". There is only one PHP.INI file
(in C:\WINDOWS) and I have run phpinfo() to confirm that this indeed is
the INI file being loaded. However phpinfo() states that the SMTP
server is "localhost" and not "".

I added an ini_set("smtp", "") right before the mail()
function and got the same error: unable to connect to "localhost".

I am not running IIS's SMTP service, and I am stumped. Any help is

Re: Failed to connect to mailserver

*** escribió/wrote (10 Aug 2006 11:57:08 -0700):
Quoted text here. Click to load it

Actually, you shouldn't ;-)

Quoted text here. Click to load it

Apparently, directives are case sensitive. Try to specify SMTP in
uppercase, as in manual and comments:

smtp_port = 25

-+ - Álvaro G. Vicario - Burgos, Spain
++ Mi sitio sobre programación web:
+- Mi web de humor con rayos UVA:

Re: Failed to connect to mailserver

Wow the one thing I failed to check -- case sensitivity! I changed
"smtp" to "SMTP", rebooted and now all is well in my world. Thanks very
much for putting and end to my frustrations!

Alvaro G. Vicario wrote:
Quoted text here. Click to load it

Site Timeline