/* All form fields are automatically passed to the PHP script through the array $HTTP_POST_VARS. */
$email = $HTTP_POST_VARS['email'];
$subject = $HTTP_POST_VARS['subject'];
$message = $HTTP_POST_VARS['message'];
/*Validation of subject and also mail */
if (!preg_match(”/w+([-+.]w+)*@w+([-.]w+)*.w+([-.]w+)*/”, $email)) {
echo “
”;
echo “Back”;
}
/* Sends the mail and outputs the “Thank you” string if the mail is successfully sent, or the error string
otherwise. */
elseif (mail($email,$subject,$message)) {
echo “