in reply to Email on every page hit

On a more philosofical level, I wonder what you are trying to accomplish?

All you get is an email for each page hit

You will find a lot more info in the log-file which is kept by the server.

This looks a lot like stupid homework with hardly any relevance to real-world situations. (O, how I hated to do such stupid homework tasks.)

CountZero

"If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law