When a user posts a message to my message board, an automatic email is sent to me so that I can read the message and delete it if it is offensive.
The posting page begins with a session that successfully collects the user id and inserts the user's psuedonym into the email.
The email arrives successfully but the message part is missing from the email as follows:
lillythepink added the following message:
The message is inserted into the message board successfully, so I think I must be assigning it incorrectly for the email.
Here is the relevant part of the code hoping that you can spot the problem
<?php // The form for posting messages
include ( 'includes/header_post.php' ) ;
echo '<h2>Post a Quotation</h2>';
// Display the form fields
echo '<form action="process_post.php" method="post" accept-charset="utf-8">
<p>Choose the Subject: <select name="subject">
<option value="Category One">Category One</option>
<option value="Category Two">Category Two</option>
</select></p>
<p>Message:<br><textarea name="message" rows="5" cols="50"></textarea></p>
<p><input name="submit" type="submit" value="post"></p>
</form>';
include ( 'includes/footer.php' ) ;
//posting an entry into the database table automaticlally sends a message to the forum moderator
// Assign the email components
$subject = "Posting added to message board";
$user = isset($_SESSION['uname']) ? $_SESSION['uname'] : "";
$message = $_POST['message'];
$body = "$user added the following message:\r\n$message";
mail("me@myisp.co.uk", $subject, $body, "From:admin@myisp.co.uk\r\n");
?>