Skip to content

Using hMailServer with SharePoint

When testing and/or developing with SharePoint it is helpful to test and use e-mail functionality. You might be working on a workflow or want to demonstrate alerts to potential stakeholders, and it would be nice to do this in your testing environment. The problem is that traditionally Exchange is used for this activity, and when you’re in a testing environment adding the bloat of Exchange to an environment that is already nearly maxed isn’t an option. Enter hMailServer.

hMailServer is a full featured e-mail server, but we’re just going to use it for e-mail relay (SMTP) (I found a post with supposedly a VB script for specifying the drop folder for incoming e-mail but haven’t worked with it). This is also only a good idea for testing purposes. While I don’t see why hMailServer cannot be used for deployments (albeit small ones) it still isn’t advisable. Most likely if you’re implementing SharePoint in your enterprise then you’re already drinking the Exchange juice so just use that.

Installing and Configuring hMailServer

1. First you’ll want to download hMailServer.

2. Start the install.

3. Move through the prompts, but choose full installation when asked.

4. It will then bring you to a screen asking you about the database to use. Since we’re already running SQL Server for SharePoint let’s use that so select “External Database Engine.” (Clicking the images will magnify them.)

Specify Database Engine
Specify Database Engine

5. After finishing the install it will open up a database wizard. The first option we’re giving is the database instance. Select the option to  create a new hMailServer database.

Create Database
Create Database

6. Then it will ask for information to connect to your database instance. The database server address is most likely your computer name (contoso for me), and then choose whatever you want to call the database. Lastly, choose the Windows authentication option for authentication mechanism (most likely the account you’re using has the dbowner role on SQL Server but if not add it).

Server Connection Info
Server Connection Info

7. Then you will be prompted to select the service instance. Select the SQL Server (MSSQLSERVER) service.

Service Instance Selection
Service Instance Selection

8. Move through the next screens (it will provision the database), and then lastly you will be prompted to specify a password for the admin account. Add one and finish the wizard.

9. Next it will open the hMailServer administrative interface. Login and expand the following nodes: Settings – Advanced – IP Ranges. Highlight My computer. Then specify as the Lower IP and as the Upper IP.

IP Relay Configuration
IP Relay Configuration

10. Now click on Domain in the navigation panel. Here you’ll add a domain. I chose my computer name (with a .com suffix), and then click advanced and specify a catch-all e-mail address. You can then exit the hMailServer administration interface.

11. Next open Central Administration. We will now specify the outgoing e-mail settings by clicking on the System Settings header on the splash page and then choosing “Configure outgoing e-mail settings.”

12.For the “Outbound SMTP server” put in your computer name, and I put in my catch-all e-mail address for the “From address” and “Reply-to address.” Save your change.

Central Admin E-mail Settings
Central Admin E-mail Settings

13. Lastly, I tested it by adding a user to a site with an e-mail specified in AD, and it worked!

E-mail Success!
E-mail Success!
Published inSharePointTutorials


  1. Chris,

    Thank you for taking the time to write up these instructions. Everything worked great except for my ISP blocking port 25 traffic. Since I am building a single VM with 2010 and all services, I simply provided a A record DNS entry pointing to and SharePoint was able to begin sending alerts. This will work great for client demos and development!

    Chris Quick

    • Thanks for the update Chris. Glad you got it working.

  2. Green2010

    Can hmail be used with 3 tier farm? If yes, can hmail be installed on wfe server? When I installed hmail on the wfe server, it did not give me the sql server option as the dependent. When I came to step 8 mentioned above, it gave me error msg: SQL server login falied for user “domainname\wfe$”. Check your database settings in hmailserver.ini. Any help is much appreciated.


    • Paula sounds like you should just use SMTP. hMail is better for dev environments.

  3. Awesome post, i followed it to the letter and it worked. Thanks for responding to my Tweet with this URL. See you at SPC12 dude

  4. Steve Anderson

    This didn’t work for me. And I debugged and found that Sharepoint was trying to send to port 587. I just changed the port that hMail was running on (25) to 587. If anyone is interested.

    • Theja

      Hi Steve,

      How to find from which port sharepoint is sending mails.
      Please let me how it can be known.


Leave a Reply

Your email address will not be published. Required fields are marked *