ok im trying to do this mail send form in my own way trying not to get any code from outside.. I HAD to copy the
Code:
if (!preg_match("/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/",
because i need it and i cant really understand it as a php begginer yet..

I know there are alot of mistakes i know most of them but i do Not know how to fix them..

Here's the Code.


PHP Code:
<?php

$output 
"no";
$check $_POST['output'];
$message $_POST['message'] ;
$topic $_POST['topic'];
$from $_POST['email'];
$to "[email protected]";

function 
checkmail($cm) {
    if (!
preg_match("/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/"$from)) {
echo 
"<a href='javascript:alert(Invalid email Address);'></a>";
    }
}

function 
checkfield($cf) {
    if (
$subject == "" || $topic == "" || $from == "" ) {
echo 
"<a href='javascript:alert(Please check the missing fields);'></a>";
    }
}

if(
$check == "yes" && $cm true && $cf true  ) {
mail($to$topic "From: $from . $message");
echo 
"<p align=\"center\"><font face=\"Verdana\" color=\"red\">You're mail has been successfully sent.</font></p>";
    }
?>

                <td height="323"><div id="contactus" class="generic">
                  <form action="<?php print $_SERVER['PHP_SELF']?>" method="post">
                    <b>Email</b>: (Required If Your expecting an answer):<br>
                    <input type="hidden" name="output" value="yes">
                    <p><input type="text" name="email" size="20"></p>
                    <b>Title</b>:<br>
                    <p><input type="text" name="topic" size="20"></p>
                    <b>Message</b>:<br>
                    <p>
                    <textarea cols="50" rows="10" name="Message"></textarea>
                    </p>
                    <input type="submit" value="send">
                    <input name="Reset" type="reset" value="reset">
                    </form>
</div>
Any advices would be super!