i will assume that the initial code you posted is the thanks2.php file, if so do this:
$to = $_POST['thereemail'];
echo $to;
// what do you get?
if you do get a valid email, then simplify the mail() call...
mail($to, 'subject', 'message');
and see if that sends and email.
if it does, add the header.
mail($to, 'subject', 'message', "From: David \n");
then, try it with the $mail_body string... that should give you an idea why it isn't sending.
i hope you realize that you can potentially send more than one email at a time because the 2nd mail call is in a while loop.
sijis