Well, your not really using the contact form solution pack any more.
For one, you are hand coding your own function to send the email.
For two, your function to send the email is not in a PHP code block.
Have you tried using the contactus.php page that was supplied?