Code:
<?php
$theiremail = $_REQUEST['email'];
$to = 'youremail@live.com';
$fields = array();
$fields{"email"} = "Email";
$body = "\n\n"; foreach($fields as $a => $b){ $body .= sprintf("%20s: %
s\n",$b,$_REQUEST[$a]); }
$headers2 = "From: $theiremail";
$subject2 = "Someone contacted you";
$autoreply = "".$theiremail."";
if($theiremail == '') {print "You have not entered an email, please go
back and try again";}
else {
$send = mail($to, $subject2, $autoreply, $headers2);
if($send)
{header( "Location: http://www.site.com/thanks" );}
else
{print "We encountered an error, please notify
webmaster@YourCompany.com"; }
}
?>
I got the code from
http://php.about.com/od/phpapplicati...orm_mail_3.htm and I altered it.