Simple Mail Transfer Protocol (SMTP) is an internet standard for transmission of electronic emails. SMTP services are used to send and receive emails in a secure manner. It’s an email solution if you are sending mails using any script from your website.
Setting up your own SMTP server on Windows Server 2019 means you have full control over email sending without relying on external services.
Here is a step by step guide to install and configure SMTP services on Windows Server 2019. SMTP by default uses TCP port 25.
Let’s start with the configuration steps of SMTP Service on Windows Server 2019
Installation of SMTP Service
- Open the Server Manager Dashboard. Click on ‘Manage’, then ‘Add Role & Features’.
- Click on ‘Next’ after this.
- Select ‘Role-based or feature-based installation’, then click ‘Next’.
- Select a server from the server pool.
- Click on ‘Next’ after selecting the role the server would play.
- Select ‘Features’. Next scroll down the list and select the ‘SMTP Server’ feature. Then click on Next.
- A new window appears to inform you that some other services can also be installed. Click “Add Features” to confirm and continue.
- Click on ‘Next’ to continue.
- Click on ‘Install’ to complete the installation.
- Once the installation has been completed, click on ‘Close’. Close button will appear after complete installation.
Configuration of SMTP Services
- Launch the Internet Information Services (IIS) 6.0 Manager.
- Right-click on ‘SMTP Virtual Server #1’ and select ‘Properties’.
- Tap the General tab and change the IP Address to the server’s IP address.
- Then tap the ‘Access’ tab and click on the ‘Connection’ button.
- In the Connection window, select ‘Only the list below’ and click on the ‘Add’ button.
- Select the ‘Single computer’ option. To use the internal SMTP, type the IP address, add ‘Group of computers’ or ‘Domain’ of the devices permitted, and then click on the ‘OK’ button.
- In the ‘Access’ tab of the Connection window, click on the ‘Relay’ button to add the same permitted devices to the Relay restrictions’ list.
- In the ‘Delivery’ tab of the Connection window, set an external domain.
- Go to ‘Run’ and type wf.msc. This will launch the Windows Firewall with Advanced Security console.
- To begin the wizard, right-click on ‘Inbound Rules’ and select ‘New Rule’.
- Select ‘Port’ and click on ‘Next’.
- Set the local port to 25 and click on ‘Next’.
- Select ‘Allow the connection’ and click on ‘Next’.
- Uncheck ‘Public’ (Ignore if you want to access the services from outside) to prevent external access to the server. Click on ‘Next’.
- Give the rule a name, and click on ‘Finish’.
- You can now see a new rule enabled in the firewall management console.
- Go to ‘Run’ and type wf.msc.
- Here you can see that SMTP services are running.
- Now you can deliver the mails with your windows server 2019 email server as per your convenience.
Also, you can configure the SMTP server in Linux too. To know how to do it, read the blog – A step by step guide on how to configure SMTP server in Linux”.
No matter which web hosting service – Windows/Linux, you have for your business, if you are not looking for a mail server and just want to send emails through contact-us form, then you can send mails from your server with the above configuration.
Read details in a report by IDC.
Hope this article helps you in setting up SMTP server on Windows 2019 easily. Feel free to drop any queries in the section below.
Update: This post has been edited for latest information on 6th Jan, 2023.
Services ZNetLive offers:
Hello Umesh, I’m from Brazil, sorry to ask in this old post, I have a service for this SMTP installed, some users complain that they are receiving notification email from the relay as below. Is there a way to configure something regarding this relay sending so that users do not receive this notification?
De:
Date: ter., 18 de ago. de 2020 às 13:34
Subject: Delivery Status Notification (Relay)
To:
This is an automatically generated Delivery Status Notification.
Your message has been successfully relayed to the following recipients, but the requested delivery status notifications may not be generated by the destination.
Hi Humberto,
Thanks for reaching out.
SMTP Relay is a feature that lets an SMTP client use an SMTP server to forward e-mail messages to a remote domain.
If the SMTP server (Relay server) does not know how to deliver the Server message, it will relay the message to a second SMTP server (based on the domain of the recipient and the lookup of the responsible mail servers for this domain).
For more help, please check with your local admin for logs.
Thanks.
Hi Priyanka,
Thanks for the feedback
Nice post author.
Hi,
This is very useful. I have a query.
Can we configure two smtp server in same domain? Also can i configure a smtp server in domain where no mail server is present to receive with the same (like exchange or 365 )
Hi Arun,
Thanks for reaching out.
Yes, you can configure two SMTP servers for same domain name. For receiving emails, mail server is mandatory.
Where can I look to troubleshoot if emails don’t seem to be getting sent from the SMTP relay server? Are there logs I can check to see what error messages I may be getting?
Thanks,
Seth
Hi Seth,
You can enable logs in SMTP server settings and then you can check it at location: C:\WINDOWS\system32\LogFiles\SMTPSVC1
Hi All,
Thanks for the post.
Have a doubt,
I want to add port 25 for SMTP serivce
I could find out there are NO SMTP features installed also NO SMTP service available on the server.
So, I can install the SMTP features and services on the server,
Post that, Do I have to add the server relay or can I just configure the SMTP Port :25 in windows firewall
Please suggest.
Hi Anton,
If SMTP service is not installed on your server, then you can install and configure the SMTP service. Refer the article: https://www.znetlive.com/blog/how-to-configure-smtp-server-in-windows-server-2016/
Your port should open immediately after configuration.
Best Regards.
Thanks for this article. Is there a powershell script I can use to import the Relay IP and range
Here are some of my questions:
1) Can I send 1-5 lakhs mails per day using this windows smtp service? If not, what’s the limit?
2) What’s mail server when setting up smtp it asked for mail, password, name, port and server. I’m asking for this server. IP is working fine but I’m looking for domain type server like name.com
3) After so much R and D, I wanna know if I ever got blocked or blacklisted what’s worst can happen? or did it affect my server, if yes what’s worst?
Hi Reetik,
Here are my answers to your questions:
1) There’s no limit applied by Microsoft on how many emails you can send per day, and the performance depends entirely upon system configurations (RAM/Disk/CPU/Bandwidth).
2) It is a simple SMTP server so you cannot set up a mail on it but you can add your domain name/mail id into the address bar.
3) Yes, if bulk emails or spams are sent from your server, then there are high chances of your server IP to get blacklisted. If all these are found regularly, then DC may suspend your server.