{"id":3679,"date":"2023-11-20T15:32:42","date_gmt":"2023-11-20T07:32:42","guid":{"rendered":"https:\/\/www.servergigabit.com\/guide\/?post_type=kb&#038;p=3679"},"modified":"2025-12-29T09:10:13","modified_gmt":"2025-12-29T01:10:13","slug":"email-server-in-windows-server-part-1-comprehensive-guide","status":"publish","type":"kb","link":"https:\/\/www.servergigabit.com\/guide\/kb\/email-server-in-windows-server-part-1-comprehensive-guide","title":{"rendered":"Email Server in Windows Server, Part 1: Comprehensive Guide"},"content":{"rendered":"<header class=\"entry-header \"><img fetchpriority=\"high\" decoding=\"async\" class=\"alignnone wp-image-3680\" src=\"https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/10-300x169.jpeg\" alt=\"\" width=\"714\" height=\"402\" srcset=\"https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/10-300x169.jpeg 300w, https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/10-1024x576.jpeg 1024w, https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/10-768x432.jpeg 768w, https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/10-1536x864.jpeg 1536w, https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/10-2048x1152.jpeg 2048w, https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/10-370x208.jpeg 370w, https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/10-1230x692.jpeg 1230w, https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/10-800x450.jpeg 800w, https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/10-390x219.jpeg 390w\" sizes=\"(max-width: 714px) 100vw, 714px\" \/><\/header>\n<header><\/header>\n<header><\/header>\n<div class=\"entry-content clear\">\n<p>&nbsp;<\/p>\n<p>This tutorial will guide you through the process of setting up an email server on a <a href=\"https:\/\/www.servergigabit.com\/windows-vps-hosting\/\">Windows Server<\/a> with a static public IP address. The steps outlined here are applicable to both VPS and dedicated servers. The email server software used in this tutorial is hMailServer, a free and open-source program that offers a simple setup process. In addition to the standard features like SMTP, POP3, and IMAP, hMailServer also has spam detection capabilities and can be integrated with a free antivirus solution like ClamWin.<\/p>\n<h2><strong>Installation<\/strong><\/h2>\n<\/div>\n<h5 data-sourcepos=\"5:1-5:37\"><strong>Step 1: Install NET Framework 3.5<\/strong><\/h5>\n<p data-sourcepos=\"7:1-7:128\">hMailServer requires NET Framework 3.5 to run properly.<\/p>\n<p data-sourcepos=\"7:1-7:128\">Open the Server Manager and follow the prompts to add NET Framework 3.5.<\/p>\n<h5 data-sourcepos=\"9:1-9:44\"><strong>Step 2: Download and Install hMailServer<\/strong><\/h5>\n<p data-sourcepos=\"11:1-11:135\">Download the latest version of hMailServer from the official website.<\/p>\n<p data-sourcepos=\"11:1-11:135\">Execute the installation package and accept the terms of service.<\/p>\n<p data-sourcepos=\"11:1-11:135\"><a href=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2017\/05\/download.png\" target=\"_blank\" rel=\"noopener\"><picture><img decoding=\"async\" class=\"alignnone size-medium wp-image-5865 webpexpress-processed\" src=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2017\/05\/download-300x171.png\" sizes=\"(max-width: 300px) 100vw, 300px\" srcset=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2017\/05\/download-300x171.png 300w, https:\/\/contabo.com\/blog\/wp-content\/uploads\/2017\/05\/download-1024x582.png 1024w, https:\/\/contabo.com\/blog\/wp-content\/uploads\/2017\/05\/download-768x437.png 768w, https:\/\/contabo.com\/blog\/wp-content\/uploads\/2017\/05\/download.png 1213w\" alt=\"\" width=\"300\" height=\"171\" \/><\/picture><\/a><\/p>\n<h5 data-sourcepos=\"13:1-13:33\"><strong>Step 3: Configure hMailServer<\/strong><\/h5>\n<p data-sourcepos=\"15:1-15:122\">Open the hMailServer Administrator application. Enable the &#8220;Automatically connect on Start-up&#8221; option and click &#8220;Connect&#8221;.<\/p>\n<p data-sourcepos=\"15:1-15:122\"><a href=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2017\/05\/start.jpg\" target=\"_blank\" rel=\"noopener\"><picture><img decoding=\"async\" class=\"alignnone size-medium wp-image-5868 webpexpress-processed\" src=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2017\/05\/start-300x151.jpg\" alt=\"\" width=\"300\" height=\"151\" \/><\/picture><\/a><\/p>\n<p data-sourcepos=\"17:1-17:110\">In the next window, go to &#8220;Domains&#8221;, choose &#8220;Add&#8230;&#8221;, and enter the domain you want to use for sending emails.<\/p>\n<p data-sourcepos=\"17:1-17:110\"><a href=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2017\/05\/domain.png\" target=\"_blank\" rel=\"noopener\"><picture><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-5870 webpexpress-processed\" src=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2017\/05\/domain-300x225.png\" alt=\"\" width=\"300\" height=\"225\" \/><\/picture><\/a><\/p>\n<p data-sourcepos=\"19:1-19:50\">Create new email addresses in the &#8220;Accounts&#8221; menu.<\/p>\n<p data-sourcepos=\"19:1-19:50\">\u00a0<a href=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2017\/05\/user.png\" target=\"_blank\" rel=\"noopener\"><picture><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-5871 webpexpress-processed\" src=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2017\/05\/user-300x226.png\" sizes=\"(max-width: 300px) 100vw, 300px\" srcset=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2017\/05\/user-300x226.png 300w, https:\/\/contabo.com\/blog\/wp-content\/uploads\/2017\/05\/user-768x578.png 768w, https:\/\/contabo.com\/blog\/wp-content\/uploads\/2017\/05\/user.png 806w\" alt=\"\" width=\"300\" height=\"226\" \/><\/picture><\/a><\/p>\n<p data-sourcepos=\"21:1-21:258\">Go to Settings &gt;&gt; Protocols &gt;&gt; SMTP &gt;&gt; Delivery of e-mail.<\/p>\n<p data-sourcepos=\"21:1-21:258\">Enter the local hostname of your server that will be used to introduce your server to other email servers.<\/p>\n<p data-sourcepos=\"21:1-21:258\">Add an A record to your DNS zone and set an identical PTR for the IP address of your server.<\/p>\n<h5 data-sourcepos=\"23:1-23:30\"><strong>Step 4: Configure Firewall<\/strong><\/h5>\n<p data-sourcepos=\"25:1-25:237\">Open Windows Firewall settings and choose &#8220;Inbound Rules&#8221;.<\/p>\n<p data-sourcepos=\"25:1-25:237\">Click &#8220;New Rule&#8221; and select &#8220;Port&#8221;. Enter ports 25, 110, 143, and 587.<\/p>\n<p data-sourcepos=\"25:1-25:237\"><a href=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2017\/05\/firewall2.png\" target=\"_blank\" rel=\"noopener\"><picture><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-5884 webpexpress-processed\" src=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2017\/05\/firewall2-300x221.png\" sizes=\"(max-width: 300px) 100vw, 300px\" srcset=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2017\/05\/firewall2-300x221.png 300w, https:\/\/contabo.com\/blog\/wp-content\/uploads\/2017\/05\/firewall2-1024x754.png 1024w, https:\/\/contabo.com\/blog\/wp-content\/uploads\/2017\/05\/firewall2-768x565.png 768w, https:\/\/contabo.com\/blog\/wp-content\/uploads\/2017\/05\/firewall2.png 1149w\" alt=\"\" width=\"300\" height=\"221\" \/><\/picture><\/a><\/p>\n<p data-sourcepos=\"25:1-25:237\">Choose &#8220;Allow the connection&#8221;, select &#8220;Domain&#8221;, &#8220;Private&#8221;, and &#8220;Public&#8221;, and enter a name for the new rule.<\/p>\n<p data-sourcepos=\"25:1-25:237\"><a href=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2017\/05\/firewall3-1.png\" target=\"_blank\" rel=\"noopener\"><picture><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-5887 webpexpress-processed\" src=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2017\/05\/firewall3-1-300x221.png\" sizes=\"(max-width: 300px) 100vw, 300px\" srcset=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2017\/05\/firewall3-1-300x221.png 300w, https:\/\/contabo.com\/blog\/wp-content\/uploads\/2017\/05\/firewall3-1-1024x754.png 1024w, https:\/\/contabo.com\/blog\/wp-content\/uploads\/2017\/05\/firewall3-1-768x565.png 768w, https:\/\/contabo.com\/blog\/wp-content\/uploads\/2017\/05\/firewall3-1.png 1145w\" alt=\"\" width=\"300\" height=\"221\" \/><\/picture><\/a><\/p>\n<h5 data-sourcepos=\"27:1-27:25\"><strong>Step 5: Configure DNS<\/strong><\/h5>\n<p data-sourcepos=\"29:1-29:35\">Add an SPF record to your DNS zone:<\/p>\n<div class=\"code-block ng-star-inserted\">\n<pre><code class=\"code-container no-decoration-radius\" role=\"text\">justanexample.com 86400 in TXT \"v=spf1 ip4:1.2.3.4 ~all\"\r\n<\/code><\/pre>\n<\/div>\n<p data-sourcepos=\"34:1-34:78\">Replace &#8220;justanexample.com&#8221; with your domain and 1.2.3.4 with your IP address.<\/p>\n<p data-sourcepos=\"36:1-36:34\">Add an MX record to your DNS zone:<\/p>\n<div class=\"code-block ng-star-inserted\">\n<pre><code class=\"code-container no-decoration-radius\" role=\"text\">justanexample.com 86400 in MX 10 \"mail.justanexample.com\"\r\n<\/code><\/pre>\n<\/div>\n<p data-sourcepos=\"41:1-41:124\">Replace &#8220;justanexample.com&#8221; with your domain and &#8220;mail.justanexample.com&#8221; with the hostname you chose for your email server.<\/p>\n<h5 data-sourcepos=\"43:1-43:34\"><strong>Step 6: Configure Email Client<\/strong><\/h5>\n<p data-sourcepos=\"45:1-45:49\">Use the following settings for your email client:<\/p>\n<p data-sourcepos=\"47:1-47:20\"><strong>Incoming server:<\/strong><\/p>\n<ul data-sourcepos=\"49:1-53:0\">\n<li data-sourcepos=\"49:1-49:16\">Protocol: IMAP<\/li>\n<li data-sourcepos=\"50:1-50:11\">Port: 143<\/li>\n<li data-sourcepos=\"51:1-51:16\">Security: None<\/li>\n<li data-sourcepos=\"52:1-53:0\">Server: The IP or hostname of your server<\/li>\n<\/ul>\n<p data-sourcepos=\"54:1-54:20\"><strong>Outgoing server:<\/strong><\/p>\n<ul data-sourcepos=\"56:1-60:0\">\n<li data-sourcepos=\"56:1-56:16\">Protocol: SMTP<\/li>\n<li data-sourcepos=\"57:1-57:11\">Port: 587<\/li>\n<li data-sourcepos=\"58:1-58:16\">Security: None<\/li>\n<li data-sourcepos=\"59:1-60:0\">Server: The IP or hostname of your server<\/li>\n<\/ul>\n<h2><strong>Security<\/strong><\/h2>\n<p>For additional security measures, such as transport encryption, spam checks, and malware protection, refer to the second tutorial: <a href=\"https:\/\/www.servergigabit.com\/guide\/kb\/email-server-in-windows-server-part-2-comprehensive-guide\">&#8220;Email Server in Windows Server, Part 1: Comprehensive Guide&#8221;<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; This tutorial will guide you through the process of setting up an email server on a Windows Server with a static public IP address. The steps outlined here are applicable to both VPS and dedicated servers. The email server software used in this tutorial is hMailServer, a free and open-source program that offers a simple setup process. In addition&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"kbtopic":[1099],"kbtag":[1195],"class_list":["post-3679","kb","type-kb","status-publish","hentry","kbtopic-tutorials","kbtag-email-server"],"_links":{"self":[{"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kb\/3679","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kb"}],"about":[{"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/types\/kb"}],"author":[{"embeddable":true,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/comments?post=3679"}],"version-history":[{"count":7,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kb\/3679\/revisions"}],"predecessor-version":[{"id":3689,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kb\/3679\/revisions\/3689"}],"wp:attachment":[{"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/media?parent=3679"}],"wp:term":[{"taxonomy":"kbtopic","embeddable":true,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kbtopic?post=3679"},{"taxonomy":"kbtag","embeddable":true,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kbtag?post=3679"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}