
MAIL CONFIG (Very urgent)
No OLE object necessary for SQL Mail. Look at xp_sendmail in BOL. It is
just a procedure that can be called to send mail, and we use it all the
time. Note that SQL Mail must be set up properly for xp_sendmail to
succeed.
Also, read all about configuring SQL Mail; it can be tricky if you have
never done it before. I wrote something a long time ago to help out
customers, perhaps it will help get you started. There is no substitute for
BOL and your own experiments though.
James
Introduction to Concepts
At first, the configuration of SQL Mail can seem like a confusing array of
different, seemingly disparate activities. By introducing the concepts and
providing the big picture here first, hopefully the process will seem more
intuitive and wont get lost in the details.
First and foremost, for SQL Server to send email using your organizations
email system, SQL Server must be just like any other user in your
organization. Even though SQL Server is not a person, in many ways it will
be set up just like any real user. SQL Server must have a domain login
account, and must have a dedicated email account. SQL Server must login
using its domain account when it starts. There must be an email profile
and email client on the SQL Server server, and that email profile must be
configured for the SQL Server domain account login. These are all things
that a real person needs in order to be able to logon to an NT domain, and
send and receive email.
Basically, we want to be in a position to physically sit down at the SQL
Server server, logon as, say, SQLServerAccount, bring up an email client
like Microsoft Outlook, and send and receive email using, say, the SQLMail
account. Other users of your email system will see SQLMail in their
address book, and should be able to send it a test message that you can open
and read. In fact, performing each of these little exercises will be part
of the configuration process described in the sections below. When these
prerequisites are complete, the final few configuration changes to SQL
Server are easy.
The points below highlight the steps mentioned above, and each will be
covered in detail in the remain sections of this chapter.
1. Create a special NT Domain user account named SQLServerAccount,
and assign special rights to that new account so that it can be used by SQL
Server.
2. Create a special email account name SQLMail.
3. Configure an email profile on the SQL Server server for the
SQLServerAccount user created in step 1, and have that profile use the
SQLMail email account created in step 2. Test the profile by
sending/receiving email to/from the SQLMail address.
4. Configure SQL Server and the SQL Server Agent to use the
SQLServerAccount, that you created in step 1, when they start.
5. Configure SQL Mail to use the profile that you created in step 3 to
use the SQLMail email account.
6. Configure SQL Agent Mail to use the profile that you created in step
3 to use the SQLMail email account.