I have this scheduled to run every 4 hours. The stored procedure it calls send an email and dumps data. The procedure dumps the data in ok but doesn't send an email using EXEC msdb.dbo.sp_send_dbmail with the job. The email sends when I manually run it however. Not sure what is wrong.
DECLARE @return_value int
EXEC @return_value = [dbo].[UPDATE_my_STATS]
SELECT 'Return Value' = @return_value