Using Apache 2.2
PHP 5.2.0
MySQL 5.0.27
Mercury Mail Server 4.01

From php.ini:

[mail function]
; For Win32 only.
SMTP = localhost
smtp_port = 25

; For Win32 only.
sendmail_from = postmaster@vermi.ath.cx

; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
;sendmail_path =

From Drupal:

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 C:\xampp\xampp\htdocs\includes\common.inc on line 1970.

However, I can connect to my server just fine using Outlook or some such. I'm not sure if this is a Drupal problem or not, but since php.ini is configured correctly, and the mail server is also configured correctly, I'm not sure what else it could be.

Does anyone have any suggestions?

Comments

styro’s picture

Is Outlook running on the same machine as Drupal? If so, is Outlook connecting to localhost or your computers hostname? Is Mercury configured to listen on localhost as well as your hostname? Does Mercury have any SMTP authentication etc configured?

It probably is a PHP configuration issue - Drupal is just passing on the PHP error it got trying to use the PHP mail stuff and Drupal doesn't add any of its own mail handling unless you install your own mail wrapper code.

--
Anton
New to Drupal? | Forum posting tips | Troubleshooting FAQ

jvermillion’s picture

Outlook is running on the same machine as Drupal, and it connects to 'localhost.'

Mercury is bound to listen on 0.0.0.0:25, no SMTP authentication is required.

Also, Mercury is set up to allow local connections to relay mail.

styro’s picture

I don't run PHP on Windows, so I don't know the finer points sorry. But it all sounds properly configured from here.

I don't think it is a relay or auth issue, because you usually get error messages to that effect when it is.

Silly question: have you restarted Apache since making your last changes to php.ini?

The only thing I can think of that will narrow it down a little bit is to trying running some example PHP script that sends a test mail.

http://www.php.net/manual/en/function.mail.php

--
Anton
New to Drupal? | Forum posting tips | Troubleshooting FAQ

chx’s picture

This is definitely a PHP config issue, Drupal uses PHP mail command that does not work. You can try searching for smtp wrapper here and install your own smtp class that might or might not work. Anyways, you need a working PHP and this is not Drupal's concern.
--
The news is Now Public | Drupal development: making the world better, one patch at a time. | Local dip sour | A bedroom without a teddy is like a face without a smile.

--
Drupal development: making the world better, one patch at a time. | A bedroom without a teddy is like a face without a smile.

jvermillion’s picture

As it turns out, some .NET programmers have had a similar problem, and their solution helped me out a bit. The culprit was VirusScan Enterprise, which was blocking php.exe from making calls to port 25.

Thanks for your help, everyone. :)