Friday, October 2, 2015

Configuring Dbmail

--check for operators
use msdb
Go
select * from msdb.dbo.sysoperators

--add operators
use msdb
Go
exec dbo.sp_add_operator @name= User1, @enabled = 1, @email_address = 'user1e@abc.com'
exec dbo.sp_add_operator @name= 'User2, @enabled = 1, @email_address = 'user2@abc.com'

--enable the database mail
USE master
GO
sp_configure 'show advanced options',1
GO
RECONFIGURE WITH OVERRIDE
GO
sp_configure 'Database Mail XPs',1
GO
RECONFIGURE
GO

--Set up account and profile.


--One last thing but most important thing left is Letting the SQL Server Agent Talk to Database Mail. If we do not perform this step we get the following error
Avoiding 'Failed to notify <operator> via email' errors

  1. -Highlight the "SQL Server Agent" in the object Explorer
  2. -Go to Properties
  3. -Go to Alert system options
  4. - Check the enable profile on and select the profile
 

No comments:

Post a Comment