Help - php mail function syntax!?

Sujacob

New member
Ok, im trying to create a send a comment page and I got everything somewhat working so far, except that I dont know how to call the function

<?
function sen()
{
$to = "[email protected]";
$email = $_REQUEST['email'];
$subject = "Contact Us $email";
$message = $_REQUEST['message'];
$headers = "From: $email";
$sent = mail($to, $subject, $message, $headers) ; if($sent)
{echo "Thank You - Your comment have been sent"; }
else
{echo "We encountered an error sending your mail"; }
}
?>


----etc...-----


<form action="sen()" method="POST" enctype="multipart/form-data" name="Contact">

Name:<br>
<input type="text" size="40" name="Name"><br><br>

Email:<br>
<input type="text" size="40" name="email"><br><br>

Comment:<br>
<textarea name="message" rows="4" cols="40">
</textarea>
<br><br>

<input type="submit" value="Send Comment">
</form>


-----------------------------

How do you get the form action to call the sen() function? is that even possible?
 
Back
Top