How to set the SMTP Port in TFS 2010 - TFS & Visual Studio ALM - by Neno Loje

TFS & Visual Studio ALM - by Neno Loje

(formerly Team System, VSTS)

News

Recent Posts

Community

Tags

Email Notifications

VSTS Blogs

VSTS Community

My Other Blogs

German VSTS Websites

Archives

How to set the SMTP Port in TFS 2010

The Problem

  • You are configuring SMTP Settings for TFS 2010 and want to specify a different port for your SMTP server than the default port (which would be port 25)

    How to specify a custom SMTP port for TFS 2010?
    Figure: TFS 2010 does not allow to set a custom SMTP port.

Solution #1: Change config file

  • As answered here and here, you could add the following XML to the TfsJobAgent.exe.config file (usually located in C:\Program Files\Microsoft Team Foundation Server 2010\Application Tier\TFSJobAgent):

<mailSettings>
  <smtp deliveryMethod="Network">
    <network port="2525"/>
  </smtp>
</mailSettings>

  • Keep in mind that this is only valid for TFS notifications itself and not for notifcations from SQL Server Reporting Services or the SharePoint-based Project Portal.

The Solution #2: Install a local SMTP server

  1. Install the SMTP Service on Windows Server and ask it to route all SMTP traffic to a different SMTP server.
  2. On the Delivery tab, click Advanced, an enter the SMTP server name as "smart host".
  3. On the Delivery tab, click Outbound Connections, and set the TCP port (= SMTP port).

Set your external SMTP server as smart host.Set TCP port to the SMTP port you want to use.
Figure: Setting up a local SMTP server has the great benefit that you can use it SMTP for other applications, too (like notifications from SQL Server Reporting Services or SharePoint).

Comments

michael said:

Installed a local SMTP server and it works great, thanks! :)

# February 18, 2012 12:26 PM

Brad said:

Could you take this further and explain how you would send the TFS emails from the server to SMTP server that requires authentication and how you would make that work. This would be very beneficial for those that have hosted TFS servers but also want to have the email functionality.Thanks.

# February 21, 2012 9:02 AM