# Install and Setup hMailServer E-Mail Server

This video tutorial will cover the basic installation and setup for hMailServer in it's simplest form. In future videos we will create and apply SSL certificates, enable Active Directory authentication for email accounts and setup the mail server for use with PHP.

## Install and Basic Inbox Setup

1. If installing to a newer Windows OS, run the following commands as an administrator to enable .NET 2
   dism /online /enable-feature /featurename:NetFx3ServerFeatures /Source:D:\sources\sxs
   dism /online /enable-feature /featurename:NetFx3 /Source:D:\sources\sxs
2. Download hMailServer Download
3. Setup DNS entries for smtp. and imap.
   1. For Windows DNS, go to Start > Windows Administrative Tools > DNS
   2. Expand the DNS server and domain name
   3. Right Click > New Host (A or AAAA)
   4. Type the dns name and target IP address > Click OK
4. Run the hMailServer installer, accepting the default values
5. Set the administrative password, re-type to confirm
6. Click Install
7. After the installation completes, Open the Start Menu > hMailServer > hMailServer Administrator
8. Select localhost > Click Connect
9. Login with the password set during the installation
10. Click Add domain...
11. Enter the domain name to be used for the e-mail addresses > Click Save
12. Click on the Accounts folder
13. Click the Add... button
14. Enter an e-mail address and a password for the inbox
15. Click the Save button
16. Expand Settings > Advanced > IP Ranges
    1. NOTE: To disable the ability to send e-mail outside the local network, delete the Internet IP Range by Right Clicking on it and selecting Remove
17. Click the Add... button
18. Enter the name LAN and fill in the appropriate lower and upper IP for your subnet
19. Review the available options, to make this a LAN only e-mail server only allow local to local e-mail addresses
20. Click Save

## Setting Up An E-Mail Client

1. Download Mozilla Thunderbird Portable Download
2. Run the downloaded paf.exe file and extract it to any location
3. Check the Run box and click Finish
4. Fill out Your name, Email address and Password for the account created earlier
5. Click Manual config
6. For Incoming, enter imap.<youremaildomain></youremaildomain>
7. For Outgoing, enter smtp.<youremaildomain></youremaildomain>
8. Click the Re-test button, Thunderbird should set some additional values
9. Click Done
10. Select I understand the risks > Done

## Testing Your New E-Mail Server

1. In hMailServer Administrator, Expand Utilities > Server sendout
2. Select Specific domain and select the domain created earlier from the dropdown
3. Fill out the form to send a test e-mail > Click Send
4. Back in Thunderbird, click the Get Messages button
5. You should receive the test e-mail