A friend of mine who works for an encyclopedia publisher shared this fact with me:
A device that dispensed holy water in a Greek temple in Alexandria, Egypt, in 215 B.C. is the earliest known vending machine.
To see how far vending machines have come, read about the one they call ‘Let’s Pizza’