RE: [PHP] Headers in body - what am I doing wrong???
| From: | Jennifer Goodie | Date: | Wed, 11 Jun 2003 21:31:41 +0000 |
| Subject: | RE: [PHP] Headers in body - what am I doing wrong??? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-151152@lists.php.net to get a copy of this message | ||
>
> // pull fields from form query
> $to = "maiser@metalbunny.net";
> $name = $HTTP_POST_VARS['name'];
> $address = $HTTP_POST_VARS['address'];
> $listname = $HTTP_POST_VARS['listname'];
> $action = strtoupper($HTTP_POST_VARS['action']);
>
> // build headers
> $from = "\"$name\" <$address>\r\n";
> $message = $action." ".$listname." ".$name."\r\n";
> $message .= "EXIT\r\n";
>
> $headers = "MIME-Version: 1.0\r\n";
> $headers .= "Content-type: text/plain; charset=iso-8859-1\r\n";
> $headers .= "From: ".$from."\r\n";
> $headers .= "Reply-to: ".$from."\r\n";
You have an extra \r\n. There is one contained in the variable $from so the
line $headers .= "From: ".$from."\r\n"; is putting \r\n\r\n which signifies
the end of the headers and the begining of the message body.