If you don't have a basic understanding then perhaps you should check out
this article. Also here is some source for basic usage:
<?
if (isset($_POST['subject']) && $_POST['message']!=='')
{
$address = "your_real_email@domain.com"; //change this to the receiving address.
$subject = "Website Email: ".$_POST['subject'];
if ($_POST['name']!=='')
{
$body = "<table border=0 cellpadding=5 cellspacing=0 width=200><tr><td>".$_POST['message']."<br>
<br>
Yours Sincerely<br>
".$_POST['name']."</td></tr></table>";
} else {
$body = "<table border=0 cellpadding=5 cellspacing=0 width=200><tr><td>".$_POST['message'].
"</td></tr></table>";
}
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'From: do_not_reply@your_website_form' . "\r\n";
mail($address,$subject,$body,$headers);
}
//below displays the form while above processes it.
echo "<form method='post'>Subject: <input type=text value='' maxlength=100 name='subject' size=30><br>
<textarea cols=30 rows=20 name='message'></textarea><br>Name: <input type='text' value='' name='name'>
<input type='submit' value='submit'></form>";
?>
If you don't have a clue what any of that code means then you have some studying to do. That code only uses basic concepts which you would use in every day coding. So perhaps a few php tutorials might help.
Reputation Points: 410
Solved Threads: 258
Occupation: Genius
Offline 3,004 posts
since Sep 2007