How to Install and Configure an SMTP Server on Windows Server 2022
Windows Server 2022 does not include a built-in SMTP server, but you can set up an SMTP relay using IIS (Internet Information Services) Manager and the Simple Mail Transfer Protocol (SMTP) feature.
Step 1: Install the SMTP Server Feature
- Open Server Manager
- Click Start → Server Manager.
2. Add Roles and Features
- Click Manage → Add Roles and Features.
- Click Next until you reach Server Roles.
- Expand Web Server (IIS) → Add SMTP Server.
- Click Next, then Install.
- Wait for the installation to complete, then close the wizard.
Step 2: Configure the SMTP Server
1. Open IIS 6.0 Manager (for SMTP configuration)
- Press Win + R, type inetmgr6, and press Enter.
- In the left panel, expand the server node.
- Right-click [SMTP Virtual Server] → Click Properties.
2. Set the IP Address
- Under the General tab, choose the server’s IP address.
3. Allow Relaying (If Required)
- Go to the Access tab → Click Relay.
- Add specific IP addresses that are allowed to send emails.
4. Set Authentication (Optional)
- Go to the Delivery tab → Click Outbound Security.
- If using an external SMTP service (e.g., Titan Mail, Office 365), enter the authentication details.
Step 3: Open the SMTP Port in Windows Firewall
- Open Windows Defender Firewall → Click Advanced Settings.
- Select Inbound Rules → Click New Rule.
- Choose Port → Select TCP → Enter 25, 587, 465 (as needed).
- Allow the connection → Name it SMTP Service → Click Finish.
Step 4: Test the SMTP Server
Open Command Prompt (cmd) and type:
telnet localhost 25
If the SMTP server responds, it is working.
You can also use PowerShell to send a test email:
Send-MailMessage -From "you@example.com" -To "recipient@example.com" -Subject "Test Email" -Body "SMTP is working!" -SmtpServer "your_server_ip"
Alternative: Use a Third-Party SMTP Server
If you need better security and deliverability, consider using Titan Mail, Office 365 SMTP, or Gmail SMTP instead of a local SMTP server.
Top comments (0)