Form submission
Essentially this code is a simple HTML Form with zero elegance but a great example. It posts to itself, wherein the PHP code looks for that post (Remember PHP provides a form post in $_POST) and then sends the message via email.
You can hack this around all you wish, its public domain code.