Here's a neat overview of how email works, from Howstuffworks.