You have to send the mail-ID to your CMail.php:
echo "<td><a href=\"CMail.php?mail_id=$row['id']\">".$row['fromuser']."</a></td>";
In your CMail.php, you need to have a query like
$query = "SELECT * FROM mail WHERE id=$id";
$msg = mysql_query($query);
etc.
<display the message here>
Note about your submitted code:
After the end of your while-loop, you do not have access any more to your result-set (the pointer being at the end), unless you reset it to the beginning with mysql_data_seek($query, 0).
Anyway, I don't understand what you want to achieve with that piece of code. At worst, it has to go into your CMail.php file ???
HTH
JJ Mouris