Q:

PHP mail sometimes sends subject only (empty body)

So the problem is that sometimes, while using the PHP mail form on my web site, it only sends the subject line and an empty body! But this only happens SOMETIMES. rarely actually. I was getting emails from web site users (with subject line, but blank body), so I assumed they just submitted form too early, until I tested a handful of emails myself, and i ended up with some blanks myself! Again, subject line is always there though.
Form CODE here: 
echo "<form method='POST' action='item.php?id=$strItemNumber'>
<table><tr><td style='vertical-align:middle;'>
Subject:<BR />
<input type='text' name='subject' value='Item # $strItemNumber'  size='19'><br />
Name:<BR /> <input type='text' name='name' size='19'>
<br />Your Email:<br />
<input type='text' name='email' size='19'>

</td><td>
Message:<BR />
<textarea rows='9' name='message' cols='60'></textarea>

</tr></table>
<input type='submit' value='Send Email' name='submitted'>
</form>";

code for email function here:
$to = "info@mydomain.com";
$subject = $_POST['subject'];
$name_field = $_POST['name'];
$email_field = $_POST['email'];
$message = $_POST['message'];
$body = "From: $name_field\n E-Mail: $email_field\n Message:\n $message\n"; 

mail($to, $subject, $body);

Do you guys have any thoughts?
Thank you

A:

Change $body to the following:
$body = "From: {$name_field} E-Mail: {$email_field} Message: {$message}"; 

