RE: [PHP] mail() some work some don't
| From: | Jennifer Goodie | Date: | Thu, 17 Apr 2003 00:33:43 +0000 |
| Subject: | RE: [PHP] mail() some work some don't | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-144212@lists.php.net to get a copy of this message | ||
You sure that $_POST['email'] has a value?
Also, I believe that the RFC calls for \r\n between headers, so even though
it will usually work with just a \n, it is technically incorrect.
> -----Original Message-----
> From: ruusvuu@whitney.dns2go.com [mailto:ruusvuu@whitney.dns2go.com]
> Sent: Wednesday, April 16, 2003 5:28 PM
> To: PHP General
> Subject: [PHP] mail() some work some don't
>
>
>
> 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
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>