jccc
11-09-2008, 01:13 AM
Can anyone tell me why the first line here concatenating fields into a message string works, but none of the others will? I've not had this problem on any of several other hosts.
$body = $name . $phone . $email . $besttime . $inquiry;
//$body = $name . ' ' . $phone . ' ' . $email . ' ' . $besttime . ' ' . $inquiry;
//$body = "Name: $name\nPhone: $phone\nEmail: $email\nBest time: $besttime\n\n$inquiry";
//$body = $name . "\n" . $phone . "\n" . $email . "\n" . $besttime . "\n" . $inquiry;
mail($recipient, $subject, $body, $headers)
I do not get any errors (even after setting "error_reporting(E_ALL)"), but simply never receive any messages sent from the form if I use any of the other three ways to create the message body string. The first line above however *does* work and does send messages from the form.
Please note that the first method works even when fields contain spaces, commas, newlines, etc. But for whatever reason, when I concatenate fields as in the other three lines, no email.
$body = $name . $phone . $email . $besttime . $inquiry;
//$body = $name . ' ' . $phone . ' ' . $email . ' ' . $besttime . ' ' . $inquiry;
//$body = "Name: $name\nPhone: $phone\nEmail: $email\nBest time: $besttime\n\n$inquiry";
//$body = $name . "\n" . $phone . "\n" . $email . "\n" . $besttime . "\n" . $inquiry;
mail($recipient, $subject, $body, $headers)
I do not get any errors (even after setting "error_reporting(E_ALL)"), but simply never receive any messages sent from the form if I use any of the other three ways to create the message body string. The first line above however *does* work and does send messages from the form.
Please note that the first method works even when fields contain spaces, commas, newlines, etc. But for whatever reason, when I concatenate fields as in the other three lines, no email.