I'm having a similar problem.
I'm running Apache 1.3.19 and PHP 4.0.5 on a Windows 2000 Professional machine. This PC is on a Windows Network corporate LAN. I have installed a Windows port of the UNIX sendmail program, configured it to use www.webmail1.com as my SMTP host, set the path (c:\sendmail) in my Windows path line, and successfully tested it from the command prompt. However, PHP is unable to connect using the mail() function. I have tried both:
SMTP = localhost
and
SMTP = www.webmail1.com
in my php.ini file. Here is the relevant code (all on one line):
mail($email, $subject, $message, "From: $adminmail\nX-Mailer: PHP/" . phpversion());
This gives me a "Failed to connect" error message. What should I do?