If ClickHome is sending notifications through the DBmail and you would like to check what has gone out.


First things first - view the database mail logs.  Right click on Database Mail, and select View Database Mail Log.  You are looking for clues here.  See any?  Nope, OK, lets look at some more logs.  

-- list log events
SELECT * FROM msdb.dbo.sysmail_log
GO

-- list error messages
SELECT * FROM msdb.dbo.sysmail_event_log
WHERE mailitem_id >= 1;

--Anything?  Hmm - OK, let's look at the mail.  There are several tables which contain mail items.  Just think about the difference between Failed items and Unsent items for a minute.  
--To list all items:
USE msdb
SELECT sent_status, *
FROM sysmail_allitems
GO

--This contains one row for each message successfully sent by Database Mail.
select * from msdb.dbo.sysmail_sentitems 


--To list the unsent items only:
USE msdb
SELECT sent_status, *
FROM sysmail_unsentitems
GO


--To list the failed items only:
USE msdb
SELECT sent_status, *
FROM sysmail_faileditems

GO 


--Resending failed messages can be done like below:


DECLARE @to        varchar(max)
DECLARE @copy    varchar(max)
DECLARE @title    nvarchar(255)
DECLARE @msg    nvarchar(max)
SELECT @to = recipients

, @copy = copy_recipients, @title = [subject], @msg = body
FROM msdb.dbo.sysmail_faileditems
WHERE mailitem_id =  59226
EXEC msdb.dbo.sp_send_dbmail
@recipients = @to,
@copy_recipients = @copy,
@body = @msg,
@subject = @title,
@profile_name = 'CHEmail',
@body_format = 'HTML';

--Don't forget to grant send mail permission to your User Role:

USE msdb;
CREATE USER chapplication FOR LOGIN chapplication;
exec sp_addrolemember 'DatabaseMailUserRole', 'chapplication'

Ensure as well that  this user role chapplication is correctly setup against the Database Mail profile ClickHome.