An excellent question! First, we put all the valid e-mail addresses into our Virtual Hat, which to the untrained eye looks exactly like an Excel spreadsheet - and is quite daft when you try to wear it.
Then, like Johnny Ball, we try to think of a number - and when that doesn't work, we ask the Internet to make us a random number between 1 and the number of lines on the spreadsheet.
Then we look up the line on the spreadsheet that corresponds to the random number and hey presto - the virtual hat has done its magic! And I have to remember to take it off before I go to the pub.