Numerical Numbering email after purchase

Hi I want to add a product to my site, that when a customer buys it, it will send them a ticket number and continue on numerically for the next customers. Like a raffle ticket or concert ticket system is this possible and anyone any tips on doing this. Thanks,
PS apologises if this is noob question.