var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Get DBMail output
With Query Anylyser, I am sending mails with DBMail successfully.
Each time mail is sent, bottom half window messages tab shows
"Mail (Id: 30242) queued."
Is there any way to capture Mail (Id: 30242) and update the same in a table?
If I understand your post, you're using sp_send_dbmail to send emails. If this is the case the information you're sending is already captured in a table:
SELECT * FROM msdb.dbo.sysmail_sentitems
Our table gets pretty busy, so we clean up anything older than a year
Now that I think about it, I should be purging this to an archiving database instead of deleting it.
DECLARE @MailDate DATETIME
SET @MailDate = DATEADD(year,-1,GETDATE())
@sent_before = @MailDate
@logged_before = @MailDate
Tags for this Thread