Avatar of brettr
brettr
 asked on

Why does mail sproc get triggered?

In sql server 2005, I'm getting the error below when trying to run a sproc.  The sproc doesn't reference mail and I'm not sure why this happens.  I have the same db on another server that doesn't throw this error.  What might be causing this?

Msg 15281, Level 16, State 1, Procedure sp_send_dbmail, Line 0

SQL Server blocked access to procedure 'dbo.sp_send_dbmail' of component 'Database Mail XPs' because this component is turned off as part of the security configuration for this server. A system administrator can enable the use of 'Database Mail XPs' by using sp_configure. For more information about enabling 'Database Mail XPs', see "Surface Area Configuration" in SQL Server Books Online.
Microsoft SQL Server 2005

Avatar of undefined
Last Comment
cyberkiwi

8/22/2022 - Mon
cyberkiwi

http://msdn.microsoft.com/en-us/library/ms190307%28SQL.90%29.aspx

The error message already indicates what you need to so, go to Surface Area Configuration and enable it.

start\Programs\SQL Server 2005\Configuration Tools\Surface Area..
Bottom link "for features"
Pick "database mail" from the left tree, on the right, click tick "Enable.."
brettr

ASKER
Thanks.

What is triggering that sproc?  I don't recall ever integrating it.
ASKER CERTIFIED SOLUTION
cyberkiwi

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
brettr

ASKER
Thanks.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
brettr

ASKER
Oh no.  I don't see the database mail option for the problem machine.  What does that mean?  I see it on the other machine.
cyberkiwi

Okay you can check using (run in query window)

exec sp_configure 'Database Mail XPs'

Result of the "run_value" column is what is currently being used (1=on, 0=off)

If that returns the error

"The configuration option 'Database Mail XPs' does not exist, or it may be an advanced option."

Then use this whole block below:

exec sp_configure 'show advanced options', 1
reconfigure
exec sp_configure 'Database Mail XPs'
exec sp_configure 'show advanced options', 0   -- reset the advanced options setting
reconfigure