Send Email Directly on TFSEstimated reading time: 6 minutes Show
My SMTP mail server requires that email be sent with TLS encryption and on port 587. This makes it problematic for Team Foundation Server (TFS) to send emails directly. To work around the problem, I installed the Windows 2008 SMTP Server service and configured it for relaying to my real SMTP mail server. Contents
Install SMTP ServerTo begin, launch Server Manager and add the SMTP Server feature. This includes a dialog to add some additional items. Click Add Required Features and, after the dialog closes, click Next > followed by Install. The same can be done from the command line using: ServerManagerCmd –Install SMTP-Server Configuring the SMTP Service to Auto-StartUnfortunately, the service is not configured to auto-start by default so you need to go into the services to change this: To perform the same action from the command line use the following PowerShell commands: Get-Service SMTPSvc | Set-Service –StartupType Automatic From DOS you could use sc.exe. Configuring the SMTP Service for Routing to Alternate SMTP ServerFinally, you need to configure the SMTP Server to redirect to an alternate SMTP server (assuming it is not sending email directly). This involves settings in both IIS 7.0 and IIS 6. Open Internet Information Server (IIS 7.0) and select the server node Internet Information Services (IIS) Manager (IIS 7.0)
To perform the same action from the command line use the following commands (Powershell is optional): appcmd.exe set config /commit:WEBROOT /section:smtp /from: Internet Information Services (IIS) 6.0 Manager
Unfortunately, I didn’t come up with the command line for this particular action. I did find two leads as to where there may be a command line solution, however:
Even though figuring out the final command line seemed within reach, I had no information as to how the password was encrypted and stored into the file and without much to go on, I decided to move on. Command LineCombining all the command lines together (except for the IIS 6.0 configuration) yields the following: ServerManagerCmd –Install SMTP-Server $SMTPService = Get-WmiObject win32_service -filter "name='SMTPSvc'"$smtpservice.ChangeStartMode("Automatic")Set-Alias appcmd "$env:windirSystem32inetsrvappcmd.exe"appcmd.exe set config /commit:WEBROOT /section:smtp /from: Note: If you are forwarding to gmail’s SMTP server, here are the settings you need:
Want More?Curious about what else you can do with Windows? Check out AAD: How to Clone/Copy a Local Windows 10 Account to an Azure Active Directory Account! How do I configure my SMTP server locally?How do I configure a local SMTP server?. You will need your Windows installation CD.. Use Add or Remove Programs in the Windows Control Panel to launch Add/Remove Windows Components.. Select Internet Information Services (IIS) and then click Details.. Check SMTP Service and then click OK.. How do I start SMTP on Windows Server 2012?Launch the Server Manager.. Select Manage > Add Roles and Features from the upper right menu. ... . Click Next, then select Role-based or feature-based installation.. Click Next to bypass the Server Roles selections.. In the feature part, scroll down and check SMTP Server.. Click Install to complete the installation.. How do I setup a printer SMTP server?To enable the Printer's Plan SMTP client go to the Settings tab, open the General Settings folder and select SMTP Settings. To use the Printer's Plan SMTP email client, in this SMTP Settings window you will need to enter your email account information.
How do I enable SMTP on Windows Server 2019?Install the SMTP Service. Launch the Server Manager. ... . From the Dashboard, Add Roles and Features. ... . Select Role-based or feature-based installation.. Select the Essentials Server (which should be highlighted by default).. Click Next to bypass the Roles selections.. Scroll down the list and tick the SMTP Server feature.. |