I have made a standard email form and is below. The only thing you need to change is the variable $address (about line 4) to your real email address to receive website emails. Also this email form supports html formatting.
<?
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>";
?>
Try not to bump 10 year old threads as it can be really annoying.
Like php then read my website at
http://syntax.cwarn23.net/
Star-Trek-Atlantis - now that's what I call a movie ^_^
My favourite PC. -
MacGyver Fan
Bad english note: dis-iz-2b4u