Create the SMTP server used by SQL Server Database Mail.
SQL Server Database Mail is required to configure BAM alerts
when using any of the following versions of
SQL: SQL Server 2016 SQL Server 2014 SQL Server 2012 SQL Server
-
2012
-
uses an SMTP server to send BAM alerts. The SMTP server is included with Internet Information Services (IIS). SMTP can be installed locally on BizTalk Server or on another server with IIS installed.
SQL Server Database
Install and
configure
the SMTP server
These steps apply to:
Windows Server 2016 Windows Server 2012
- R2
- Windows Server 2012
Install
the SMTP server
-
In Server Manager, select Dashboard in the left pane
-
Select Add roles and features. Adding roles and features can also be opened from the Manage menu in the upper right corner.
-
Under Before you begin,
-
Role-based or feature-based installation
-
Select a server from the server group, select the desired server, and select Next. The Server Selection window lists the servers that have been added using Add Server in Server Manager. By default, select the local server.
-
Server Roles, select Next
-
Under Features, turn on SMTP Server. If prompted, select Add Features. Select Next.
-
Under Confirmation, select Restart the destination server automatically if necessary, and select Install. When you’re done, select Close.
.
select Next. Select
and select Next. Select
Under
.
Configure
the SMTP server
The following steps configure the SMTP virtual server by using
IIS 6.0 Manager:
-
Open IIS Manager: On Start, locate inetmgr6.exe and open it
-
Expand the computer name. Right-click [SMTP Virtual Server #1] and select Properties.
-
On the Access tab, select the Relay button
-
Select Add. For Single Computer, type 127.0.0.1 and select OK.
By adding 127.0.0.1, we are allowing the local server to send messages from this SMTP server. If you want other computers to send messages from this SMTP server, enter their IP addresses.
-
On the Delivery tab, select Outbound Security. Choose one of the following options
:
Anonymous access: No account name or password required. This option disables authentication for the SMTP server.
Basic authentication: The account name and password of the server you are connecting to are sent in clear text. This login account transmits the emails. Basic authentication can be selected when sending email to a personal account or to an Exchange account. Because credentials are passed in clear text, we recommend that you enable TLS encryption.
Integrated Windows authentication: The domain account name and Windows password are used to authenticate. The account you enter transmits the emails.
TLS encryption: Similar to SSL, TLS secures the connection. Requires a valid SSL server certificate installed on this server.
-
On the Delivery tab, select Outbound Connections. By default, TCP port is 25. A different port can be entered if it is open inside your firewall. Select OK.
-
On the Delivery tab, select Advanced. By default, the Fully Qualified Domain Name of the local server appears. Depending on the Internet provider, the Smart Host property may remain empty. You may need to contact your Internet provider to confirm if a smart host is required. Otherwise, you may be able to enter smtp.EMailProvider.com.
-
Select OK to close all windows
-
Restart the SMTP server: Right-click [SMTP Virtual Server #1], select Stop, and then select Start. A restart is required to apply SMTP server settings.
.
.
.
Windows Server 2008 R2
: Install and configure the SMTP server Install the SMTP
server
The following steps install the
SMTP Server feature: In Server Manager, select Features and select Add Features.
- Under
-
Add
-
Features, select SMTP Server. If prompted, select Add required role services and select Next.
-
Continue with the installation by selecting Next
-
In the Confirm Installation Selections window, select Install. When you’re done, select Close.
.
Configure
the SMTP server
The following steps configure the SMTP virtual server by using
IIS 6.0 Manager: Open IIS 6.0 Manager
-
: On Start, locate IIS and select Internet Information Services (IIS) 6.0 Manager.
-
Expand the computer name. Right-click [SMTP Virtual Server #1] and select Properties.
-
On the Access tab, select the Relay button
-
Select Add. For Single Computer, type 127.0.0.1 and select OK.
By adding 127.0.0.1, we are allowing the local server to send messages from this SMTP server. If you want other computers to send messages from this SMTP server, enter their IP addresses.
-
On the Delivery tab, select Outbound Security. Choose one of the following options
:
Anonymous access: No account name or password required. This option disables authentication for the SMTP server.
Basic authentication: The account name and password of the server you are connecting to are sent in clear text. Basic authentication can be selected when sending email to a personal account or to an Exchange account. Because credentials are passed in clear text, we recommend that you enable TLS encryption.
Integrated Windows authentication: The domain account name and Windows password are used to authenticate. The account you enter transmits the emails.
TLS encryption: Similar to SSL, TLS secures the connection. Requires a valid SSL server certificate installed on this server.
-
On the Delivery tab, select Outbound Connections. By default, TCP port is 25. A different port can be entered if it is open inside your firewall. Select OK.
-
On the Delivery tab, select Advanced. By default, the Fully Qualified Domain Name of the local server appears. Depending on the Internet provider, the Smart Host property may remain empty. You may need to contact your Internet provider to confirm if a smart host is required. Otherwise, you may be able to enter smtp.EMailProvider.com.
-
Select OK to close all windows
-
A restart is required to apply SMTP server settings. To restart the SMTP server: Right-click [SMTP Virtual Server #1], select Stop, and then select Start.
.
.
Test SMTP Server
Telnet can be used to test SMTP server configuration. The following steps send a message through the configured SMTP server to an e-mail address. For more information about telnet commands, go to Windows Commands: telnet.
-
Open a command window as an administrator.
-
At the command prompt
, type: telnet
localhost 25
If telnet is not installed, install it by
typing:
pkgmgr /iu:”TelnetClient”
-
Start the communication by typing
:
EHLO Server
Enter the
- @*
YourProvider*.com
For example, type
:
MAIL FROM: EmailAddress@outlook.com
-
YourEmailAddress*@*YourProvider*.com
For example, type
:
RCPT TO: EmailAddress@outlook.com
-
Tell the SMTP server that you are ready to send data
-
Press Enter twice
-
message body by typing:
This is the body of
-
the
test
-
Press Enter, type a period (.) and press Enter
.
Check the RCPT TO address for the e-mail message. If the email is not delivered (Check your Inbox and Spam folder), the message was not sent successfully and may reside in the SMTP queue folder (C:\inetpub\mailroot\Queue).
email address of: MAIL FROM: *YourEmailAddress*
Enter the email address to: RCPT TO: *
by typing: DATA Enter the subject by typing: Subject: Test message
. Enter the
message.