Let's say you have all the data you want (for this example we'll use $name and $address only). I'll assume this is going to be an array with the following setup:
$name["user"] or $name[id]
$address["user"] or $address[id], where "name" and "id" are the same for both.
You'll then have to find the id for each:
for ($id=0;$id<count($name);$id++) {
// send mail to $name[$id] at address $address[$id]
}
Hope this helps.