Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Setup a Local Only Email Server (Windows Only)

Setup a Local Only Email Server (Windows Only)

1 - Install hMailServer

Download hMailServer from here:

  • In setup, select internal db engine.
  • Now you have a service called hMailServer and an administration program on the Windows start menu (hMailServer Administrator).

2 - Create a domain

  • Open hMailServer Administrator program.
  • Click on "Domains" and then "add domain".
  • At "domain name" put a fake domain to test. Use "" (without the quotes): hMailServer requires a fully qualified domain, so, we cannot use @localhost.
  • Make sure to add your domain ( to hosts file: C:\windows\system32\drivers\etc\hosts

3 - Change server name

  • Expand Settings > Protocols > SMTP -> Delivery of e-mail
  • At "Host name" put "localhost" (without the quotes).
  • Check if TCP Port is 25.

4 - Create an account

  • Go to "Domains", click on the created domain, and then click on "accounts", then "add account".
  • At "address", create your account name, here I use "rael" (without the quotes), and put a password.
  • Change "Administration level" to "Server".

5 - Configure "catch-all" address

  • Enabling this, you can use any email address ending with you fake domain. Example: here, my unique account is But while testing systems, I can use any address like,, etc, because all will be redirected to
  • Open "Domains", click on your domain, open Advanced tab, fill field "catch-all address" with account created on previous step.

6 - Configure an Email client

  • At Windows, you can use Windows Live Email (
  • Of course, you can use any email client.
  • While configuring
    • Incoming Server is POP3, and the username is the full email address (like, and the password is raw text (no encrypt).
    • POP3 and SMTP server are "localhost" (without the quotes).
    • Outgoing server do not require authentication.
  • Don't use the email client and the hMailServer Administration application at the same time!

This comment has been minimized.

Copy link

@casprine casprine commented May 28, 2017

Really helpful


This comment has been minimized.

Copy link

@taylormathewson taylormathewson commented Jun 6, 2017



This comment has been minimized.

Copy link

@kiumbe kiumbe commented Sep 13, 2017

hello, am hapi for the tutorial, helped me alot. configured local email server and its working but cliet mail works only when openedfrom the computer running hmailserver. when i try to configure outlook in another pc within my LAN, it cant go through. i am on a LAN with computers connected to a router with internet available. i dont want to access my mail server from outside the lan, just within the lan, what should i do sir?


This comment has been minimized.

Copy link

@Philosoraptor Philosoraptor commented Sep 16, 2017

Very helpful, thanks.


This comment has been minimized.

Copy link

@anne052486 anne052486 commented Sep 26, 2017

Is it applicable if we have static IP in workstation?


This comment has been minimized.

Copy link

@maximousblk maximousblk commented May 24, 2018

@kiumbe try editing the host file of every pc on your lan network


This comment has been minimized.

Copy link

@charlottetan charlottetan commented Jul 28, 2019

Ran into issues getting the Windows Mail client to work, got an error code 0x8007139f. Turns out it's because the Mail was missing a couple of privacy permissions. I turned on permissions for Email via the Settings app and worked for me after.

More info:


This comment has been minimized.

Copy link

@diegombt diegombt commented May 30, 2020

Thanks man, great Gist!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment