You might need to do it in batches of 500 if you have a lot. Use Shift+Click to select multiple message at once and then use the Delete button.