mail() some work some don't
| From: | ruusvuu at whitney dot dns2go dot com | Date: | Thu, 17 Apr 2003 00:28:06 +0000 |
| Subject: | mail() some work some don't | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-144208@lists.php.net to get a copy of this message | ||
Hello Gang -
I have a mail() script that works just fine
I copied it to another page and it returns anonymous@ instead of the person who
filled out the form
CODE:
<?php
$to = "ruusvuu@whitney.dns2go.com";
$subject = "GWA Information Request\n";
$msg = "This information has been submitted:\n\n";
foreach ($_POST as $key => $val)
{
if ($key == 'email')$email = $val;
$msg .= "$key: $val\n";
}
$headers = "From: <$email>\n";
$headers .= "Reply-To: <$email>\n";
?>
Some html
<?php
if($key)
{
mail($to, $subject, $msg, $headers) or die ("Couldn't send mail!");
}
?>
Thanks