我的PHP代码:
<?php
// variables to receive value from my form below
$to=$_POST['to'];
$subject=$_POST['subject'];
$message=$_POST['message'];
$from="exp@example.ccom";
$header="recevide from".$from;
// the condition to do if i click on submit input
if($_POST['sub']){
mail($to,$subject,$message,$header);
echo "Your message is successfully sent !!";
} else {
echo "noway what fuck !!!";
}
?>
// form section (simple form)
<form action="<?php echo $PHP_SELF; ?>" method="post">
<p> Send To :</p><input type="text" name="to" />
<p>Subject :</p><input type="text" name="subject"/>
<p>Message : </p><textarea name="message" cols="30" rows="15" > </textarea>
<p><input type="submit" name="sub" value="Send Message"/></p>
</form>