How to: Configure SMTP Server and E-mail Notification Settings in the Services Web.Config File

You can configure Team Foundation Server to use an existing SMTP server to send e-mail alerts. Users can configure alerts for various project, work item, and build event notifications. Although you can specify the SMTP server during Team Foundation Server installation, you might want to change the STMP server later. Similarly, if you change the application pool service account by using the TFSAdminUtil ChangeAccount command, you must manually change the sender account e-mail address to the new service account's e-mail address. You can change the e-mail address by using the emailAddress parameter of the ChangeAccount Command or by manually editing the Services Web.Config file. However, to change the SMTP server, you must manually edit the Services Web.Config file.

Important noteImportant Note:

If you used a system account (such as Network Service) as the service account for Team Foundation Server, you must configure your SMTP server to allow anonymous senders to send e-mail. If you do not, no e-mail notifications will be sent.

The content of Team Foundation Server alert e-mails is not customizable. The content of the e-mails is automatically generated from the TeamFoundation.xsl file. Modifying this file is not recommended. If you do modify the contents of this file, be sure to thoroughly test your modifications. Incorrect modifications of this file can result in the failure of Team Foundation Server e-mail alerts and the inability to view Team Foundation work items, changesets, or files in a Web browser.

Required Permissions

To perform this procedure, you must be a member of the Administrators group on the Team Foundation application-tier server. For more information, see Team Foundation Server Permissions.

To designate or change the SMTP server for sending e-mail alerts

  1. On the application-tier server for Team Foundation, locate the installation directory for the application tier.

  2. Open the Web Services directory, and then open the Services subdirectory.

  3. In a text or XML editor, open the Web.Config file, and locate the <add key="smtpServer"> element.

Note

Even if you are logged on with administrative credentials, you must start the text or XML editor as an administrator to perform this function on a computer that is running Windows Server 2008 or Windows Vista. To start the program as an administrator, click Start, click All Programs, right-click the program you want to use, and then click Run as administrator. For more information, see the Microsoft Web site.

  1. Update the element by typing the fully qualified domain name of the SMTP server. For example, type the following string:

    <add key="smtpServer" value="SMTPServerLocation" />
    
  2. Save and close the file.

    You must close and restart the Web services application for Team Foundation before your changes will take effect.

To designate or change the sender e-mail address for e-mail alerts

  1. On the application-tier server for Team Foundation, locate the installation directory for the application tier.

  2. Open the Web Services directory, and then open the Services subdirectory.

  3. In a text or XML editor, open the Web.Config file, and locate the <add key="emailNotificationFromAddress"> element.

  4. Update the element by typing the e-mail address that is associated with the service account (for example, Domain/TFSService) that is used for the application pool identity for Team Foundation. For example, type the following string:

    <add key="emailNotificationFromAddress" value="TFSService@domain.com" />
    
  5. Save and close the file.

    You must close and restart the Web services application for Team Foundation before your changes will take effect.

See Also

Tasks

How to: Add or Edit Alerts

How to: Receive Build Notification E-Mail

Concepts

Services Web.Config File Settings in Team Foundation Server Components

Managing and Resetting Service Accounts and Passwords

Reference

ChangeAccount Command

Other Resources

TFSAdminUtil Command-Line Commands