include("config.php");
$tomail = $adminemail;
$tel = $home_tel;
$work = $work_tel;
if($name && $email2){
$subject = "$sitename -- Contact Page";
while( list($key,$val) = each($_POST) ){
$amsg .= "
$key : $val
\n";
}
$headers = "From: $name <$email2>\r\nReply-To: $replyto\r\n";
$headers .= "X-Sender: <$email2>\n";
$headers .= "X-Mailer: PHP\n"; // mailer
$headers .= "Return-Path: <$tomail>\n"; // Return path for errors
$headers .= "Content-type: text/html\n\n";
mail($tomail,$tel,$work,$subject,$amsg, $headers);
echo "
Your Message Has Been Sent";
}
?>