I am not sure what is wrong with your code, but it doesn't have any Error Trapping to tell you if it has crashed.
The code that I use does not use a Query def as it is not necesarry, you only need to use a Recordset.
I am not sure if you want to mail out one email or multiple emails from the query?