sp_dbSendmail loop

Hi,

I start an inifinite loop that results in thousands of emails being queued.

I stopped tdb mail from sending

using this proc

USE msdb
GO
EXECUTE dbo.sysmail_stop_sp
GO

The problem is I need to find the queue of emails but I cant find them.

I tired this query but there are no unsent items -

select count(*) from msdb.dbo.sysmail_unsentitems;

But its says there are no unsetn items yet each time I restart I get a lot of emails sent to me.

any ideas where there is queue of items are?

Thanks.

July 19th, 2015 5:05pm

Hi, 

try to execute this:

sysmail_help_queue_sp @queue_type = 'Mail' ;
GO

* There are two queue_type in Database Mail: the mail queue and status queue. The mail queue stores mail items that are waiting to be sent. The column "length" give you the number of emails items in the specified queue.

Free Windows Admin Tool Kit Click here and download it now
July 19th, 2015 7:21pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics