SQL MAIL and SQL Agent Mail using POP3 and SMTP

How many times have you had
problems sending SQL MAIL or SQL Agent Mail from SQL Server because the
Exchange server was taken down or not working? Have you ever tried to connect
up SQL Mail and/or SQL Agent mail to Exchange through a firewall or across
domains, only to find out that you cannot use your Exchange in these
situations? Maybe you don’t have Exchange but you would still like to setup SQL
Server to send email. If you have experienced these problems then you might
want to consider using POP3 and SMTP services for supporting your SQL Mail and
SQL Agent mail requirements. This article will discuss how to setup SQL Server
to use POP3 and SMTP services to support SQL Mail and SQL Agent mail.

Advantages to using POP3 and SMTP for SQL MAIL and SQL Agent Mail

There are a number of
advantages to using POP3 and SMTP services to support SQL Mail and SQL Agent
mail. The biggest advantage is sending mail using SMTP allows SQL Mail and
SQL Agent mail to work with most firewall rules since SMTP protocols normally are
not blocked. Using POP3 and SMTP for SQL Mail and SQL Agent mail also provides
all the same functionality of using Exchange. Therefore this means no SQL
Server mail functionality will be lost using POP3 and SMTP as a mail solution
for SQL Server. This may not seem like much of an advantage, but I have seen a
number of SMTP solutions that only provide a subset of SQL Server mail
functionality, plus none of these other SMTP solutions provide SQL Agent step
and job notification mail services.

Guidelines for setting POP3 and STMP services

Prior to setting up SQL
Server to use POP3 and SMTP to read and send email your SQL Server machine will
need to be able to connect to a POP3 and SMTP service somewhere. I will not be
discussing how to setup POP3 and/or SMTP in this article, but will offer some
suggestion on where you might consider placing these services. Basically the
POP3 and SMTP services can reside on any machine, even the SQL Server machine
itself. In order to assure that SQL Mail and SQL Agent mail will work using
the POP3 and SMTP services, these services will need to be available whenever
SQL Server needs to read or send mail. Although these services do not have to
be physically installed on the SQL Server machine, having them on the SQL
Server machine might provide a very reliable environment, since no network
access would be required for SQL Server to access these services.

Once you have established an
environment that provides POP3 and SMTP services then you are ready to set up
SQL Mail and SQL Agent Mail on your SQL Server machine.

Gregory Larsen
Gregory Larsen
Gregory A. Larsen is a DBA at Washington State Department of Health (DOH). Greg is responsible for maintaining SQL Server and other database management software. Greg works with customers and developers to design and implement database changes, and solve database/application related problems. Greg builds homegrown solutions to simplify and streamline common database management tasks, such as capacity management.

Latest Articles