check if the db has message while sending email