Those are not errors. They are codes Iv written to check if mailaddress is valid, that all
fields are filled out, etc. But If you dont want them iv removed them in the script below. :
<?php
# Global variables
$from = escapeshellcmd($_POST["from"]);
$subject = escapeshellcmd($_POST["subject"]);
$message = escapeshellcmd($_POST["message"]);
# Prints out the email form
if(!$_POST) {
echo "<form method='post' action='$_SERVER[PHP_SELF]'>";
echo "Your emailaddress<br><input type='text' name='from' size=60><br>";
echo "Subject<br><input type='text' name='subject' size=60><br>";
echo "Message<br><textarea name='message' cols=52 rows=11></textarea><br>";
echo "<input type='submit' value='SendMail'>";
echo "</form>";
}
else {
# Sends the mail. (Change address below to your address)
mail("emailaddress@domain.com", $subject, $message, "From: $from");
echo "Your mail is sent!</p>";
echo "<a href='$_SERVER[PHP_SELF]'>Try again</a>";
}
?>