does the action of the form send the URL parameter as well?
when the form submits, it reloads the page, including the recordset, if the URL parameter is not a part of the action, the recordset will be empty at the time the UE code is running to send the email.
use the following code for the forms action to force it to retain any querystring variables:
action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?><?php echo (isset($_SERVER["QUERY_STRING"]) && $_SERVER["QUERY_STRING"] != "")?"?".htmlspecialchars($_SERVER["QUERY_STRING"]):""; ?>"