Create Email Server on Windows WAMP

Setting up a local email server can be useful for testing email delivery and creating email templates. Learn how to setup an email server on windows using WAMP and integrate it with a webmail interface.

Create Email Server on Winows WAMP

You will need following for this setup:

First of all enter two host enteries in V-Hosts file of WAMP. First one for main domain and second one for webmail interface. The file can be found at the following location on windows.
C:\wamp\bin\apache\Apache2.2.11\conf\extra\

<VirtualHost *:80>
    DocumentRoot "c:/wamp/www"
    ServerName test-domain.com
    ServerAlias www.test-domain.com
</VirtualHost>
<VirtualHost *:80>
    DocumentRoot "c:/wamp/www/roundcube"
    ServerName mail.test-domain.com
    ServerAlias www.mail.test-domain.com
</VirtualHost>

You will have to add an entry to windows hosts file for above virtual hosts. The windows hosts file can be found on the following location on windows.c:\windows\system32\drivers\etc\

Assuming you know how to install WAMP and get it running. I am going to show you the rest two steps hMailServer and Roundcube webmail interface setup. After you have downloaded both follow these steps to install hMailServer.

Install & Configure hMailServer:

  1. Run the setup of hMailServer you downloaded.  
  2. Click "Next".
  3. Click checkbox "I accept the agreement" and click "Next".
  4. Set the destination folder where you want to install hMailServer and click "Next".
  5. Choose components you intend to install, check both available components and click "Next".
  6. Click  checkbox "User built-in database engine" and click "Next".
  7. Click "Next".
  8. Set the password you will need this password to connect to server. Click "Next".
  9.  After all above steps click "Install" to continue installing hMailServer.
Now after installation, launch hMailServer and connect. It will prompt for the password you entered during installation enter the password and connect.

1. On welcome screen click on domains on left side navigation panel and then click on "Add" on top right buttons.

Create Email Server on Winows WAMP-01

2. Enter a domain name of your choice, for this post I am using "test-domain.com". Click Save.

Create Email Server on Winows WAMP-02

3. Click on Accounts on left side navigation panel and then click on "Add" on top right buttons.

Create Email Server on Winows WAMP-03

4. Enter email address and password for the account and then click "Save".

Create Email Server on Winows WAMP-04

Configure Roundcube:

1. Extract the roundcube files you have downloaded to "www" directory in WAMP and rename it to "roundcube".
2. Open a browser and enter the url "localhost/roundcube/installer"
3. On the first screen you will see the status of environment normally its all good at this step you just have to click "Next".

Create Email Server on Winows WAMP-05

 4. On following step page you don't have to change all just enter database host, database name, username for database and password in  "Database Setup" section. Also enter the host for SMTP server in "SMTP Settings" section. Click "Create Config".

Create Email Server on Winows WAMP-06

5. This is final step you will see the "Test Config" page. Click the button "Initialize Database" and all done.
Now open "mail.test-domain.com" in any browser and you will see the following page.

Create Email Server on Winows WAMP-07

Enter the email address and password you configured in hMailServer and login. You should be able to login your inbox and you should be seeing the following page.

Create Email Server on Winows WAMP-08

 All Done! You just created an email server and webmail interface on local windows machine.
NOTE: If you are still having issues make sure you followed all the steps carefully if it still doesn't work you may need to add an exception for hMailServer in firewall or change the "Require SMPT Authentication in hMailServer Administrator Panel ➞ Settings ➞ Advanced ➞ IP Ranges ➞ My Computer "