faqts : Computers : Programming : Languages : PHP : Common Problems : Email

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

28 of 40 people (70%) answered Yes
Recently 5 of 10 people (50%) answered Yes

Entry

How can I use an mail() to capture and mail HTML form variables to a mail recepient?

Feb 16th, 2001 10:06
Andres Märtin, Sriram Lakshmanan, Ben Udall,


Source of mail.php
<?
if($REQUEST_METHOD == 'POST'){
mail($mailaddress,$subject,$message,$header);
}
?>
...and your html file:
<form name="myform" method="POST" action="mail.php">
<input type=text name="mailaddress">
<input type=text name="subject">
<input type=text name="message">
<input type=text name="header">
<input type=submit value="Submit form">
</form>