<?php
if (!isset($_POST['email']) || $_POST['subject'] == '' || $_POST['body'] == '') {
echo <<<HTML
<form method="POST">
<strong>Name:</strong><br><input name="from" /><br><br>
<strong>Subject:</strong><br><input name="subject" /><br><br>
<strong>Message:</strong><br>
<textarea name="body" rows="20" cols="60"></textarea>
<input type="submit" name="email" value="Send" />
</form>
HTML;
}
else {
mail('nick@nickgfx.com', $_POST['subject'], $_POST['body'], 'From: '.$_POST['from']);
echo 'Thank you for taking the time to contact us. If you left your
email I will get back to you shortly.';
}
?>