View Single Post
Old 04-04-2005, 03:59 PM  
austinth
Confirmed User
 
Join Date: Jul 2002
Location: Fantasy Island
Posts: 1,770
php coders, I need your help...

how do I get this code to send me an email with the person who is sending it email in the from area of an email, right now it puts my own email address in there so i cant hit reply send. i have to manually copy paste the senders email from the contents of the mail that i receive.

here is the code im using:
<?

// Configuration Settings
$SendTo = "[email protected]";
$SubjectLine = "subject";
$ThanksURL = "thankyou.html"; //confirmation page
$Divider = "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";

// Build Message Body from Web Form Input
$MsgBody = @gethostbyaddr($_SERVER["REMOTE_ADDR"]) . "\n$Divider\n";
foreach ($_POST as $Field=>$Value)
$MsgBody .= "$Field: $Value\n";
$MsgBody .= "$Divider\n" . $_SERVER["HTTP_USER_AGENT"] . "\n";
$MsgBody = htmlspecialchars($MsgBody); //make content safe

// Send E-Mail and Direct Browser to Confirmation Page
mail($SendTo, $SubjectLine, $MsgBody, $emailaddress ,"From: $http_referrer\n");
header("Location: $ThanksURL");
?>
austinth is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote