Cari Blog Ini

06 Juli 2012

Msg 15281: SQL Server blocked access to procedure 'dbo.sp_send_dbmail' of component 'Database Mail XPs'

Error Messages:


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.



Note:
Use the Database Mail XPs option to enable Database Mail on this server.
The possible values are:
• 0 indicating Database Mail is not available (default).
• 1 indicating Database Mail is available.




Solution:

1.
-----------------------------------------------------------------------------------------
/* code:start */
-----------------------------------------------------------------------------------------
-- To allow advanced options to be changed.
sp_configure 'show advanced options', 1;
GO

-- To update the currently configured value for advanced options.
RECONFIGURE
GO
-----------------------------------------------------------------------------------------
/* code:end */
-----------------------------------------------------------------------------------------

Result Messages:
Configuration option 'show advanced options' changed from 1 to 1.
Run the RECONFIGURE statement to install.


2.
-----------------------------------------------------------------------------------------
/* code:start */
-----------------------------------------------------------------------------------------
-- To enable the feature.
sp_configure 'Database Mail XPs', 1;
GO

-- To update the currently configured value for this feature.
RECONFIGURE
GO
-----------------------------------------------------------------------------------------
/* code:end */
-----------------------------------------------------------------------------------------

Result Messages:
Configuration option 'Database Mail XPs' changed from 0 to 1.
Run the RECONFIGURE statement to install.


Source:
http://msdn.microsoft.com/en-us/library/ms191189.aspx