Hmm, well its never a stupid question if you don't know the answer! Instead of getting the ids from both db's, why not just select the name and email adress from the db and do something like this..
$conn = mysql_connect();
$db = mysql_db_select();
$sql = "select name,email from table";
$qr = mysql_query($sql, $conn);
$message = "the mailing message";
#use a for loop!
for($i=0; $i < mysql_num_rows($qr); $i++) {
mail($i["email"],$message,$re);
}
something like that.