Configure SMTP E-mail (IIS 7)

Applies To: Windows 7, Windows Server 2008, Windows Server 2008 R2, Windows Vista

Configure SMTP e-mail in IIS when you want to deliver e-mail messages from your site. Mail can be delivered immediately or it can be delivered to a file location on disk where it can be retrieved for delivery later. For example, a company can provide an e-mail link for sending feedback messages or for requesting information.

noteNote
The e-mail configuration settings are consumed by the classes in the System.Net.Mail namespace. ASP.NET applications must use this namespace in for the configuration settings to have any effect.

noteNote
The SMTP server is not installed by default. SMTP can be added through the Features Summary area of the Server Manager tool in Windows Server® 2008.

Prerequisites

For information about the levels at which you can perform this procedure, and the modules, handlers, and permissions that are required to perform this procedure, see SMTP E-mail Feature Requirements (IIS 7).

Exceptions to feature requirements

  • None

To configure SMTP e-mail for a Web application

You can perform this procedure by using the user interface (UI), by running Appcmd.exe commands in a command-line window, by editing configuration files directly, or by writing WMI scripts.

User Interface

To Use the UI
  1. Open IIS Manager and navigate to the level you want to manage. For information about opening IIS Manager, see Open IIS Manager (IIS 7). For information about navigating to locations in the UI, see Navigation in IIS Manager (IIS 7).

  2. In Features View, double-click SMTP E-mail.

  3. On the SMTP E-mail page, type the e-mail address of the sender in the E-mail address text box.

  4. On the SMTP E-mail page, select one of the following delivery methods:

    1. Deliver e-mail to SMTP server: to deliver e-mail messages immediately. This requires an operational SMTP server for which the user has credentials.

    2. Store e-mail in pickup directory: to store e-mails in a file location on disk for later delivery by an application such as an ASP.NET application, or by a user, such as an administrator.

  5. If Deliver e-mail to SMTP server is selected, do the following:

    1. Type the unique name of your SMTP server in the SMTP Server text box or select the Use localhost box to set the name to LocalHost. Setting the name to LocalHost means that ASP.NET will use an SMTP server on the local computer. Typically, this is the default SMTP virtual server.

    2. Enter a TCP port in the Port text box. Port 25 is the SMTP standard TCP port and is the default setting. More than one virtual server can use the same TCP port if all servers are configured by using different IP addresses.

    3. Under Authentication Settings, specify the authentication mode and credentials if your SMTP server requires these.

  6. If Store e-mail in pickup directory is selected, type the batch e-mail location in the Store e-mail in pickup directory text box.

  7. Click Apply in the Actions pane.

Command-line

Deliver e-mail messages immediately

To configure SMTP e-mail to deliver e-mail messages immediately, use the following syntax:

appcmd set config /commit:WEBROOT /section:smtp /from: string /deliveryMethod:network /network.port: int /network.defaultCredentials:True|False /network.host:string /network.userName:string /network.password:string

The variable from string is the e-mail address of the sender. The variable /deliveryMethod:network configures IIS to deliver e-mail messages immediately. The variable /network.port int sets the TCP port that is used by IIS to deliver e-mail messages. The variable /network.host string specifies the host used for SMTP transactions. The variable network.defaultCredentials:True|False enables or disables authentication using the default network credentials. If defaultCredentials is set to True, Kerberos or NTLM will be used if the server supports these protocols. The variables network.userName:string and network. password:string set a Basic authentication user name and password.

Store e-mails for later delivery

To configure SMTP e-mail to store e-mails in a file location on disk for later delivery by an application, such as an ASP.NET application, or by a user, such as an administrator, use the following syntax:

appcmd set config /commit:WEBROOT /section:smtp /from: string /deliveryMethod:PickupDirectoryFromIis|SpecifiedPickupDirectory /SpecifiedPickupDirectory:string

The variable from string is the e-mail address of the sender. The variable/deliveryMethod:PickupDirectoryFromIis|SpecifiedPickupDirectory configures IIS to store e-mails in a file location on disk for later delivery. The variable /SpecifiedPickupDirectory string sets the file location on disk in which to store the e-mail messages for later delivery.

noteNote
When you use Appcmd.exe to configure the <mailSettings> element at the global level in IIS 7, you must specify /commit:WEBROOT in the command so that configuration changes are made to the root Web.config file instead of ApplicationHost.config.

For more information about Appcmd.exe, see Appcmd.exe.

Configuration

The procedure in this topic affects the following configuration elements:

  • <mailSettings>

For more information about IIS 7 configuration, see IIS 7.0: IIS Settings Schema on MSDN.

WMI

Use the following WMI classes, methods, or properties to perform this procedure:

  • SmtpMailSettingsSection

For more information about WMI and IIS, see Windows Management Instrumentation (WMI) in IIS 7. For more information about the classes, methods, or properties associated with this procedure, see the IIS WMI Provider Reference on the MSDN site.

See Also

Tags :


Community Content

Sen Jacob
SMTP Configuration Settings in Windows 7 IIS
This article is definitly helpful... :) $0$0 $0 $0Those who are not able to find <strong><span> $0SMTP Configuration Settings in Windows 7 IIS$0 </span></strong>, please install<strong> Remote Server Administration Tools for Windows 7</strong> from here... $0 $0$0 <blockquote><mtps:InstrumentedLink NavigateUrl="http://www.microsoft.com/en-us/download/details.aspx?id=7887" runat="server" xmlns:mtps="http://msdn2.microsoft.com/mtps">http://www.microsoft.com/en-us/download/details.aspx?id=7887</mtps:InstrumentedLink></blockquote> $0$0 $0 The details can be found here.. $0 $0$0 $0 $0<mtps:InstrumentedLink NavigateUrl="http://support.microsoft.com/kb/974877/en-us" runat="server" xmlns:mtps="http://msdn2.microsoft.com/mtps">http://support.microsoft.com/kb/974877/en-us</mtps:InstrumentedLink> $0
Tags :

Mr _G
Windows 7 SMTP E-Mail
SMTP E-Mail will be available if you add ASP.NET service to IIS<br />
Tags :

Saravanan Sundaresan
SMTP was dropped out in Client OS ?
if SMTP was dropped out in Client OS then why the article says Applies To: Windows 7, Windows Server 2008, Windows Server 2008 R2, Windows Vista... <br /><br />Change the article.
Tags :

SteveSchofield-IISMVP
Help Video.
<p> <mtps:InstrumentedLink NavigateUrl="http://www.smtp.ws/articles/videos/" runat="server" xmlns:mtps="http://msdn2.microsoft.com/mtps">http://www.smtp.ws/articles/videos/</mtps:InstrumentedLink> <br /> </p> <p>Go to the Install SMTP Service, add 127.0.0.1 video.</p>
Tags :

whitsey
This help document is USELESS!!!
I have been toiling over this for the past 4 hours and have successfully activated the SMTP feature in IIS 7.5.<div><br /></div><div>After trying everything possible, I can not get it to work... and the documentation available here is useless in helping diagnose why.</div><div><br /></div><div>I have a strange feeling, after re-reading this document, that the NOTE:</div><span>NoteThe SMTP server is not installed by default.<br /></span><div><span>quite possibly is Microsofts way of saying " BTW setting this feature up without a SMTP server wont work "... I have not tested and confirmed this but it would definitely not surprise me!!! </span></div><div><span>I had to post this to illustrate the poor quality of documentation!!! Even if this is not the solution, then I'm just as stuck as before...</span></div><div><span><br /></span></div><div><span>How difficult would it be to put a pre-requisite of "SMTP server is required" or Once configured you must ... to start the service!!!!</span></div><div><span><br /></span></div><div><span>Microsoft!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!</span></div>
Tags :

SteveSchofield-IISMVP
Updated link
<mtps:InstrumentedLink NavigateUrl="http://www.iislogs.com/steveschofield/iis7-post-23-vista-and-smtp-server-where-is-it" runat="server" xmlns:mtps="http://msdn2.microsoft.com/mtps">http://www.iislogs.com/steveschofield/iis7-post-23-vista-and-smtp-server-where-is-it</mtps:InstrumentedLink>
Tags :

WHITELIONX
.....
<b>SMTP E-mail does not exist in IIS manager &gt;.&gt; on Win7 Home Premium.</b>
Tags :

Rahul Layak
SMTP configuration in windows7
I can't configure the SMTP in my windows7 ultimate for a web application purpose...what should be the sender's email id in the case of localhost server ? besides this,what are the steps I have to follow to config SMTP...plz help me

JTV_
No SMTP Settings in IIS
Not sure why but i've installed the SMTP service and there are no SMTP settings anywhere in IIS manager. I can configure the SMTP server in IIS Manager 6 but there is not a trace of SMTP in the actuall IIS Manager.<br /><br />Running R2. Thinking of just using apache and linux as microsoft's latest products have been a time black hole for me lately. A lot of very fundamental features do not work any more. Microsoft is making a good case for Linux these days.
Tags :

cybersaphire
SMTP was drooped on client OS since Vista
<mtps:InstrumentedLink NavigateUrl="http://weblogs.asp.net/steveschofield/archive/2006/12/19/iis7-post-23-vista-and-smtp-server-where-is-it.aspx" runat="server" xmlns:mtps="http://msdn2.microsoft.com/mtps">http://weblogs.asp.net/steveschofield/archive/2006/12/19/iis7-post-23-vista-and-smtp-server-where-is-it.aspx</mtps:InstrumentedLink>

paul6151
not helpful enough
It is stated that:<br /><br /><em>Applies To: Windows 7, Windows Server 2008, Windows Server 2008 R2, Windows Vista<br /></em><br />And this note too:<br /><br /><em>The SMTP server is not installed by default. SMTP can be added through the Features Summary area of the Server Manager tool in Windows Server® 2008. <br /></em><br />But it is not stated how to do this in Windows 7 and Vista!
Tags :

Page view tracker