Jump to content


This topic is now archived and is closed to further replies.


Can't Setup Local Email Server

Recommended Posts

I'm following online tutorials and I'm doing everything as described, when I try to test it and send a test email I get the error message:


Sending of message failed.
The message could not be sent because the connection to SMTP server localhost was lost in the middle of the transaction. Try again or contact your network administrator.


Any ideas?


1. I create a new user in mercury

2. and then go in Thunderbird and set everything up.

3. email as chase1@localhost,

4. I add the correct password,

5. I choose POP3 and SMTP as localhost


everything like it's described in the tutorials, yet it's not working.


I hope someone can help with this.

Share this post

Link to post
Share on other sites

I tried to use hMailServer and I'm having the same problem.


I run the diagnostics tool and this is the result:


Test: Collect server details
hMailServer version: hMailServer 5.3.3-B1879
Database type: MSSQL Compact

Test: Test IPv6
IPv6 support is available in operating system.

Test: Test outbound port
SMTP relayer not in use. Attempting mail.hmailserver.com:25
Trying to connect to host mail.hmailserver.com...
Trying to connect to TCP/IP address on port 25.
Connected successfully.

Test: Test MX records
Trying to resolve MX records for
ERROR: MX records for domain could not be resolved

Test: Test local connect
Connecting to TCP/IP address in MX records for local domain domain
ERROR: MX records for local domain could not be resolved


I got green light for everything except of the MX records, I don't really know what it is and how I can fix it, I'd appreciate any tips.


I'll try to research a bit more in the meanwhile.


Share this post

Link to post
Share on other sites

Ok Ok,


I feel like a million times, I've finally got it to work.


For every body who is wondering the same question, here's how I set it up:


I'm using using hMail Server instead of Mercury, because the interface looks much better and it's easier to set up.


hMail Server Setup:


1. Add Domain

2. Choose domain name like phpmail.local

3. Add account like mail@phpmail.local

4. type in your password

5. go to advanced, auto ban and disable auto-ban to make sure you're not getting banned while testing

6. go to settings, protocols, smtp, click on the register "Delivery of Email" and type into the box called "local host name" and click save.

7. You can now try to run the diagnostics tool



Microsoft Office Setup:


I recommend using Microsoft Office instead of Thunderbird, because it has better error reporting, so you always know where EXACTLY the problem lies, I never was able to tell that with Thunderbird.


Go to File -> Add Account and ...

1. Choose the option Manually Configure Server and click next.

2. Choose Internet E-Mail and click next.

3. type in your desired name. e.g. Mail PHP

4. type in your hMail Server email. Our example was: mail@phpmail.local

5. choose POP3

6. Incoming Server:

7. Outgoing Server:

8. Username: Your hMail email. Our example was: mail@phpmail.local

9. Password: Your hMail password.

10. tick remember password

11. I left SPA unticked.


Now comes the important part, otherwise it won't work:


12. click on the More Settings button

13. go to the register Outgoing Server

14. tick the option "My outgoing server (SMTP) requires authentication"

15. and then make sure the option "Use same settings as my incoming mail server" is ticked as well.


Finally click on OK and then on next, Microsoft Office is going to try to send a test message, it should work as it is now and in a few seconds you should get your automatically generated test message.


If you create a second account, you can send emails back and forth.



If you still get error messages, look what the message is saying in Microsoft Office and try to pin point it down.




It took me about 6 hours but finally it's working and I can get back to programming PHP scripts.


Hope that helped.

Share this post

Link to post
Share on other sites

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.