Click here to Skip to main content
15,868,141 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
run exec sp_configure 'show advanced options',1

setting all database mail configure in sql server after this run below code but fail sending mail.

SQL
EXEC sp_send_dbmail
@profile_name = 'testmail',
@recipients = N'govindupkp@gmail.com',
@subject = 'Alerts',
@body='test mail
Posted
Updated 22-Aug-14 1:08am
v2
Comments
Herman<T>.Instance 22-Aug-14 7:25am    
with what error message?
Herman<T>.Instance 22-Aug-14 7:25am    
With show advanced options you are able to change options hat cannot be changed by default. Perhaps one of them associates with email.

1 solution

Hi,

After setting show advanced options to 1, you can list the advanced options by using sp_configure. In order to enable the Database Mail, run the following:
SQL
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'Database Mail XPs', 1;
GO
RECONFIGURE
GO


Try to change
SQL
EXEC sp_send_dbmail

to
SQL
EXEC msdb.dbo.sp_send_dbmail


By the way, I would advise you to read this: Configuring Database Mail in SQL Server[^].
 
Share this answer
 
v5

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900