To stop SQL Server for sending unwanted mails we required to
clean the unsent mail from database mail queue. We can do this by running below
queries.
- SELECT * FROM
msdb.dbo.sysmail_event_log;
- -- To get
number of unsent emails
- select count(*)
from msdb.dbo.sysmail_unsentitems;
- -- remove
all the unsent emails
- delete from
msdb.dbo.sysmail_unsentitems;
Now all the unexpected email hav been removed from SQL Server database
mail queue.
No comments:
Post a Comment