Go to icloud.com, open Mail, then select them in batches (click the first message, scroll down, shift-click the last message) and press your delete key. The server usually has problems deleting that many at once, so you should try a smaller number, say 500, and delete them in batches.