Small Examples of Working with Database Mail Queue in MSSQL
Stopping Database Mail exec msdb.dbo.sysmail_stop_sp Cleaning the history of undelivered messages -- If the number of records in the msdb.sysmail_allitems table is very large, -- then use the @sent_before parameter to limit the deleted records exec msdb.dbo.sysmail_delete_mailitems_sp @sent_status =