Cannot connect to server localhost : Mercury/PHP

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Cannot connect to server localhost : Mercury/PHP

Postby Thermos » 14. January 2010 15:14


I've looked through the forum, but couldn't find anything that worked..

I've got the latest version of XAMPP, and everything was working fine for the last couple of days, until I ran a php email script this morning: I got the following error:

Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set()

This script was working fine yesterday. Thinking it might be a Windows security update that might have changed things, I've checked the Windows Firewall, and specifically opened port 25 for SMTP.

I have checked the Mercury admin panel, and the SMTP server and POP servers are both saying "Offline" - I've tried stopping/restarting Mercury, and also tried running it as a Windows service

Would greatly appreciate any help as I'm pretty stuck..

Posts: 2
Joined: 14. January 2010 14:49

Re: Cannot connect to server localhost : Mercury/PHP

Postby Thermos » 14. January 2010 16:06

Hi, meant to add:

I'm using version XAMPP 1.7.3 and Win Xp Pro SP3

If I do a port-check I get the following:

Apache (HTTP) 80 Program: C:\xampp\zampp\apache\bin\httpd.exe
Apache (WEBDAV) 81 free
Apache (HTTPS) 443 Program: C:\xampp\zampp\apache\bin\httpd.exe

MySQL 3306 Program: C:\xampp\zampp\mysql\bin\mysqld.exe

Mercury(SMTP) 25 free
Mercury(POP3) 110 free
Mercury(IMAP) 143 Program: C:\xampp\zampp\MercuryMail\mercury.exe
Mercury(HTTP) 2224 Program: C:\xampp\zampp\MercuryMail\mercury.exe
Mercury(Finger) 79 free


When I do a HTTP://localhost, I do get the splash screen
Posts: 2
Joined: 14. January 2010 14:49

Re: Cannot connect to server localhost : Mercury/PHP

Postby whiterican » 01. February 2010 21:08

I'm getting the same issue... Yet sometimes they work and other times they don't. It's frustrating as heck. One minute on next email try off. :oops:

and all needed modules are selected. Servers remain offline.

What windows services could interfere with Mercury Mail? And what protocol would be necessary to change that.

I do have limited networking on my pc/server certain file/folder sharing and only recently as I have been trying to work out this bug set a remote desktop connection so that I could manage my pc/server at home. any suggestions Please advise.

My current sendfile.ini is

Code: Select all
tls off
tls_certcheck off
auth plain
password xxxxxxxxxxx

and php has ;unchecked for sendfile and looks like

Code: Select all

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

; For Win32 only.
sendmail_from = postmaster@localhost

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

This whole deal with this is confusing...

any suggestions please advise
Posts: 32
Joined: 13. December 2009 02:19

Re: Cannot connect to server localhost : Mercury/PHP

Postby Emmaus » 08. February 2010 21:38

I sent several days getting my PHP, Mercury Mail, and Outlook Express to work in localhost mode.. I did not mess with any of the PHP.ini settings, they are just the way I downloaded and installed XAMPP. Rather, I set things up in Mercury Mail and Outlook Express. Everythings seems to work fine and have never had any working issues. Hope this helps.

My current installation: Microsoft XP Home addition with all latest updates, XAMPP 1.7.3, Outlook Express 6

Outlook Express Setup
1. outlookexpress > tools > accounts > properties >
2. General tab > account name – Localhost, Name: Test User 1, Organization: blank, E-Mail address: testuser1@localhost (some tutorials I found included .com after localhost, as in, but I could not get this to work), Include this account when receiving mail or synchronizing – checked
3. Servers tab > My incoming mail server is a – I used POP3, Incoming mail (POP3):, Outgoing mail (SMTP):, Account name: testuser1, Password: what ever you choose (since this is a local email test site I used testuser1
4. Connection tab > Always connect to this account using: unchecked
5. Apply > OK > Close
6. minus out Outlook Express

Configure Mercury Mail
1. start the XAMPP Control Panel Application make sure Apache, MySql, and Mercury are running, if not start the applications
2. select Mercury Admin > configuration > Manage local users > Add, Username: testuser1, Personal name: Test User 1, Mail password: testuser1 (Note: the three entries must match what was entered in Outlook Express), OK
3. configuration > MercuryS SMTP Server >General tab, Announce myself as:, TCP/IP timeout: 30, ESMTP maximum size: 0, Listen on TCP/IP port: 25, IP Interface to use:, Display session progress and debugging, OK
4. configuration > MercuryP POP3 Server, Listen on TCP port: 110, IP Interface to use:, Enable ‘Daylight Savings-proof’ message IDs – checked, Refuse access when no password is defined – checked, OK
5. configuration > MercuryE SMTP Client, Identify myself as:, Name servers:, Save
6. configuration > MercuryD POP3 Client, Under the POP3 Account Information, if Host is not listed, and Username testuser1 is not listed then select ADD, POP3Host:, Username: testuser1, Password: testuser1 (Note: these three entries must be the same as used above), OK, under the POP3 Account Information, under the Host there should now be an entry and under the Username there should be an entry testuser1, SAVE
7. minus out the Mercury admin screen – Note: if you X out the admin screen Mercury Mail will stop running, and you have to restart it, again

Testing Outlook and Mercury Mail
1. call up Outlook Express > create new mail > To: testuser1@localhost, Subject: test message, Content: test message sent at put the time of day this was sent (Note: I always put the time of day on the test messages in case there is a system problem or the messages are delayed for some reason, then I can somewhat track which messages are working and which are not), SEND (Note: If the system is working up to this point the test message will show up in the incoming mail box folder, if not, first select Send/Receive in Outlook Express. If it still doesn't work then recheck all of the setting above and try again. Due to system differences some of the settings may vary from system to system.

One final note, I am only using Outlook Express as a localhost email client. Good Luck and hope this helped.
Posts: 1
Joined: 08. February 2010 20:31

Re: Cannot connect to server localhost : Mercury/PHP

Postby srebbul » 24. February 2010 17:26

If this is not a bug, it is at least a nuisance in 4.7 :

I have found 2 workarounds on the net:
1. Cycle offline/online
Go to the Mercury Admin and then:
File -> Enter offline mode
File -> Leave offline mode.

This workaround makes Mercury as a service useless.

2. Disable MercuryX.
Go to the Mercury Admin and then:
Configuration -> Protocol modules -> Disable MercuryX.
File -> Exit
Start Mercury again

This workaround makes MercuryX unavailable.

Choose your option depending on which disadvantage suites you best.

Good luck

Posts: 1
Joined: 24. February 2010 17:05

Re: Cannot connect to server localhost : Mercury/PHP

Postby whiterican » 07. March 2010 22:37

disabling mercury x worked appreciate your help
Posts: 32
Joined: 13. December 2009 02:19

Re: Cannot connect to server localhost : Mercury/PHP

Postby havenraze » 09. March 2010 05:53

I followed the instructions from the earlier post but for some reason, the main never came to on the inbox. The Mercury Server tells me that it has successfully created the jobs but I can see 1 Pending on the Outgoing jobs.
I'm using MS Outlook 2007, Windows Vista Home Premium (32-bit), and XAMPP 1.7.3.
Posts: 1
Joined: 09. March 2010 05:42

Re: Cannot connect to server localhost : Mercury/PHP

Postby whiterican » 13. March 2010 02:26

Here is what I have found with regard to Email sending and receiving after hassles.

Most mail goes undelivered with a live account because the A. one the email servers are not accurate in the example.. And B. It seems unless you obtain a static ip delivery will mostly fail as well. Because MS rejects it with a message. another is configurations... specifically ip/networking configurations. Your routers firmware must support what you are trying to do. I had to obtain third party firmware to make everything happen as it should.

Trial and error...
Posts: 32
Joined: 13. December 2009 02:19

Re: Cannot connect to server localhost : Mercury/PHP

Postby fountaininternet » 25. March 2010 20:08

Rob, thanks so much for that tip. I was struggling with this for hours until I found your post. It works perfectly.

Posts: 1
Joined: 25. March 2010 20:01
Location: Wales, UK

Re: Cannot connect to server localhost : Mercury/PHP

Postby thompcha » 24. August 2010 20:57

Thank you, thank you, THANK YOU, ROB! I created an account on this forum just so I could tell you how grateful I am!
Posts: 2
Joined: 24. August 2010 20:52

Re: Cannot connect to server localhost : Mercury/PHP

Postby Amit_UK » 03. October 2010 22:16

Hello All. I've been having exactly the same problems as the OP though now solved thanks to Rob.
There's also a patch available for the mercuryX module issue at the following URL (though only for Mercury version 4.72):
Posts: 1
Joined: 03. October 2010 22:11

Re: Cannot connect to server localhost : Mercury/PHP

Postby WilliL » 04. October 2010 16:40

thanks for this hint
Posts: 660
Joined: 08. January 2010 10:54
Operating System: Win7Home Prem 64 SP1

Re: Cannot connect to server localhost : Mercury/PHP

Postby ulysses » 31. October 2010 21:59

I have been around the Internet and back again in search of a solution to this problem. A big thankyou to Rob-- disabling MercuryX did the trick. And a big thankyou to Amit_uk for the link. This fixed it permanently (I'm assuming!). I'll be back to this forum for sure.

Thanks again, both of you.

Posts: 1
Joined: 31. October 2010 21:45

Re: Cannot connect to server localhost : Mercury/PHP

Postby IanH » 18. November 2010 07:15

Hi I am new here and have installed xampp 1.7.3 most things work ok but when I attempt to start Mercury all I get is an "interactive services dialog detection" popup. The control panel says Mercury has started but I am unable to get into admin, clicking the admin button does nothing.
I am running Vista Home Premium (unfortunately 32 bit).
hoping for some answers on this problem
Thankyou in advance
Posts: 1
Joined: 18. November 2010 06:48

Re: Cannot connect to server localhost : Mercury/PHP

Postby JonB » 18. November 2010 16:34

What was your intended use of Mercury?

User avatar
AF Moderator
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7

Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 39 guests