If you run a Windows Server, you might need to send automated emails — such as system alerts, user notifications, or application reports — directly from your server. To do that, you need a properly configured SMTP (Simple Mail Transfer Protocol) server.
SMTP is the standard email-sending protocol used by applications and services to deliver outgoing messages. Configuring it correctly ensures smooth communication between your server and email clients or external mail systems.
In this guide, we’ll walk you through how to install, configure, and test an SMTP server in Windows Server (applicable to Windows Server 2016, 2019, and 2022).
What Is SMTP and Why You Need It
SMTP (Simple Mail Transfer Protocol) is a communication protocol used to send emails between servers or from an application to an email client.
If your Windows Server hosts a web application, intranet system, or service that needs to send notifications or reports, SMTP allows it to do so efficiently — without relying on third-party mail clients.
Common Uses of SMTP on Windows Server:
- Sending application-generated alerts and reports.
- Automating system and security notifications.
- Relaying internal emails across a private network.
- Integrating with software like IIS, Exchange, or SQL Server for email delivery.
Step 1: Install the SMTP Server Feature in Windows Server
Windows Server includes an SMTP feature via IIS (Internet Information Services), but it’s not installed by default. You’ll need to add it manually using Server Manager.
To install the SMTP Server feature:
- Open Server Manager from the Start menu.
- Click Manage → Add Roles and Features.
- In the wizard, click Next until you reach the Features section.
- Scroll down and select SMTP Server.
- When prompted, click Add Features.
- Click Next, then Install.
- Wait for the installation to complete and click Close.
Note: You might also need IIS 6 Management Compatibility if you’re using older management tools.
Step 2: Open IIS 6.0 Manager to Configure SMTP
The SMTP service in Windows Server is managed through the IIS 6.0 Manager console, even in newer versions of Windows Server.
- Press Windows + R, type:
inetmgr6and press Enter. - The IIS 6.0 Manager window will open.
- Expand your server name, then expand [SMTP Virtual Server #1].
This is your default SMTP server instance, ready for configuration.
Step 3: Configure the SMTP Virtual Server Properties
Now, let’s set up the SMTP server so it can send and relay emails securely.
A. General Settings
- Right-click [SMTP Virtual Server #1] → Properties.
- Under the General tab, ensure:
- The IP address is set to your server’s network IP.
- The TCP port is
25(default for SMTP).
- Click Advanced if you want to add multiple IPs or domains.
Tip: If another service already uses port 25, you may need to configure SMTP to use a different port (like 587).
B. Access Settings
- Go to the Access tab and click Authentication.
- Ensure Anonymous access is checked (for internal relay).
- Click Connection → select Only the list below → add IP addresses of devices or apps allowed to use your SMTP server.
- Click Relay → choose Only the list below and add internal systems or web servers that should relay mail through your SMTP server.
- Click OK to save the settings.
Important: Never enable open relay — it can turn your server into a spam relay and get your IP blacklisted.
C. Messages Settings
- Go to the Messages tab.
- Configure:
- Limit message size (e.g., 10 MB).
- Limit number of recipients per message (e.g., 100).
- Badmail directory — where undelivered messages are stored.
- Click OK to save changes.
Step 4: Configure the SMTP Pickup Directory (Optional)
SMTP uses a Pickup Directory to automatically send out emails placed as .eml files.
- Open IIS 6.0 Manager.
- Right-click [SMTP Virtual Server #1] → Properties → Delivery tab.
- Click Advanced → Outbound Security if you’re using authentication.
- Under Smart Host, specify your external SMTP relay (for example, Gmail SMTP:
smtp.gmail.com). - Click OK and restart the SMTP service.
Tip: The Pickup Directory is usually located here:
C:\Inetpub\Mailroot\Pickup
You can drop .eml files into this folder to automatically send mail through your SMTP service.
Step 5: Configure Firewall and Security Rules
If your SMTP server will send mail to external servers (like Gmail or Outlook), ensure your firewall and network rules allow outbound traffic on port 25, 465, or 587, depending on your SMTP setup.
- Open Windows Defender Firewall → Advanced Settings.
- Click Outbound Rules → New Rule.
- Select Port → TCP → specify ports
25, 465, 587. - Allow the connection → choose the appropriate profiles → name it SMTP Outbound Rule.
Tip: If your ISP blocks port 25, configure your relay on port 587 (with TLS).
Step 6: Test the SMTP Server
Once configured, test your SMTP server to make sure it’s working properly.
Method 1: Using PowerShell
Open PowerShell and run:
Send-MailMessage -To "recipient@example.com" -From "sender@yourdomain.com" -Subject "SMTP Test" -Body "This is a test email." -SmtpServer "localhost"
If configured correctly, you’ll receive the test email in your inbox.
Method 2: Using Telnet
- Open Command Prompt and type:
telnet localhost 25 - If you see
220 <your server name> Microsoft ESMTP MAIL Service, your server is responding correctly.
Step 7: Restart the SMTP Service
After configuration, restart the SMTP service to apply your changes.
Command Prompt Method:
net stop smtpsvc
net start smtpsvc
Services Method:
- Press Windows + R → type
services.msc→ press Enter. - Find Simple Mail Transfer Protocol (SMTP).
- Right-click → Restart.
Bonus: Using External Relay with Authentication (Gmail Example)
If you want to use Gmail as your relay SMTP server:
- Go to IIS 6.0 Manager → SMTP Virtual Server → Properties → Delivery → Outbound Security.
- Select Basic Authentication and enter your Gmail credentials.
- Check TLS encryption.
- Under Advanced → Smart Host, enter:
smtp.gmail.com - Restart the SMTP service.
Note: You may need to create an App Password in Gmail (if 2FA is enabled) instead of using your regular password.
Wrapping Up
Setting up an SMTP server in Windows Server lets you handle email delivery directly from your machine — perfect for system alerts, web applications, and automation workflows.
By following this step-by-step guide, you’ve learned how to install the SMTP feature, configure access and relay permissions, and test the service to ensure it’s sending emails successfully.
Once properly configured, your Windows Server becomes a reliable email relay, capable of handling both internal and external communications efficiently.