ciao a tutti, prima di tutto mi scuso se sono nella sezione sbagliata, in tal caso chiedo di essere spostato in quella giusta

ho uno script php che mi permette di inviare mail in formato html
questo è lo script
Codice PHP:
 <?php
// read the list of emails from the file.
$email_list file("elist.txt");
 
// count how many emails there are.
$total_emails count($email_list);
 
// go through the list and trim off the newline character.
for ($counter=0$counter<$total_emails$counter++) {
   
$email_list[$counter] = trim($email_list[$counter]);
   }
 
// implode the list into a single variable, put commas in, apply as $to value.
$to implode(",",$email_list);

$subject "BOLLETTINO Angeli per un giorno";
$message "<html><body>

ciao questa è una prova di invio.</p>


 grazie</p>

</body></html>"
;
$headers  'From: [email]bollettino@anxxxxxxxxxx.it.it[/email]' "\r\n";
$headers .= 'MIME-Version: 1.0' "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' "\r\n";

if ( 
mail($to,$subject,$message,$headers) ) {
   echo 
"The email has been sent!";
   } else {
   echo 
"The email has failed!";
   }
?>
ora volevo sapere come devo fare per inserire nel testo html dati prelevati da database, premetto che so stampare i dati in una pagina php con questo script

Codice PHP:

<?php
    $conn
=mysql_connect("62.149.xxx.xxx""Sql386xxx""767xxxxx");
    if (!
$conn)
    {
        die(
"Connessione a Mysql non riuscita " mysql_error());
    }
    
    
$db=mysql_select_db("databasesqlxxxxx"$conn);
    if (!
$db)
    {
        die(
"Connessione al Database non riuscita " mysql_error());
    }    
?> 

        
    <?php
        $Risultato
=mysql_query("select * from iscrizione"$conn);
        if (!
$Risultato)
        {
            die(
"La tabella selezionata non esiste " mysql_error());
        }

        while (
$riga=mysql_fetch_array($Risultato))
        {
        echo 
"<div>" $riga[4] . "</div></div>"
        
;
        }
    
?>
l'unico problema è che non so come fare a combinarli tra di loro.
un grazie a tutti quelli che sapranno aiutarmi
ciao
c