--- Joshua <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I am using the following script to send the results of a html form to
> email:
>
> <?
>
> # RegisterGlobals OFF
>
> $name = $_POST['NAME'];
> $email = $_POST['EMAIL'];
> $event = $_POST['EVENT'];
> $guests = $_POST['GUESTS'];
> $submit = $_POST['SUBMIT'];
>
> # Email Body
>
> $body_form_email = "Email: $email\n"
>
> . "Name: $name\n"
> . "Email: $email\n"
> . "Event: $event\n"
> . "Guests: $guests\n"
> . "Submit: $submit\n"
> . "\n"
> . "";
>
> # Send the email to the form owner
>
> mail("[EMAIL PROTECTED]", "IMPORTANT GUEST LIST REQUEST",
> $body_form_email, "From: [EMAIL PROTECTED]");
> # Redirect user to FAIL page
>
> header("Location: http://www.adamscenx.com/scenx/confirmation.htm");
> exit;
> ?>
>
> I am having a problem. The email is coming through with the from email
> and the subject just fine. However, the body of the email is not coming
> through in the email. The variables are only coming through in the
> header of the email. I have used my webmail, Thunderbird, and Yahoo!
> accounts and only can view the results of the form when I select 'View
> All Headers' - the results are only available in the header which is
> kind of a pain with all the other information there.
>
> I have used this same script in the past with no issues... can any offer
> an explanation and/or possible solution???
The RFC for email indicates that you should use carriage return plus linefeed
(\r\n) at each line ending in the body plus at the end of each line in the
header.
By using the 4th argument in the mail() function, you are adding custom headers
and here you do not have any line ending after the From: email address. This
could cause confusion in some MTAs (Mail Transport Agents; ie mail server) and
some MUAs (Mail User Agents; ie mail client).
The operating system where you are running PHP can be a factor. Sometimes when
running PHP on Windows servers the mail() function and its options do not
perform as consistently as they do on a Unix/Linux machine.
James