Ciao

sono un paio di giorni che mi imbattento in u problema con la funzione mail,

praticamente vorrei inviare una mail con php e il messaggio delle mail devono essere dei dati letti attraveso un ciclo (for,while è uguale),

pero non funziona


<?php
$mittente = 'From: "Il mio nome" <io@mioserver.it> \r\n';
$destinatario = "bob@server.com";
$oggetto = "email di prova";

$messaggio =
"<html>
<body>
<font size='+3' color='#00FF00' face='Times New Roman, Times, serif'>
<div align='right'>Salve Serineon

</div>
</font>
Oggetto: Richiesta Preventivo



****Dovrebbe esserci il risultato di una query che ho messo sotto la query è integrata nel html *****

</body>
</html>";// Fine mesaggio


//inizio query

<?php
session_start();
require_once('conn.php');// richiamo il file di connessione
$ip=$_SESSION["ip"];

$query=mysql_query("select * From carrello where ip='$ip' ")or die ("Query non valida: " . mysql_error());
$num1=mysql_num_rows($query);

?>
<table align="center" cellpadding="0" cellspacing="0" width="940" border="0" >
<tr class="cella2">
<td width="101">Id Prodotto </td>
<td width="682" height="30">Nome Prodotto </td>
<td width="70">Q.tà </td>
</tr>
<?php

$tot1=0;
for($i=0;$i<$num1;$i++)

{
$id=mysql_result($query,$i,"id");
$id_art=mysql_result($query,$i,"id_art");
$id_prod=mysql_result($query,$i,"id_prod");
$nome=mysql_result($query,$i,"nome_prod");
$prezzo=mysql_result($query,$i,"prezzo");
$quantita=mysql_result($query,$i,"quantita");
$stampa=mysql_result($query,$i,"stampa");
if($stampa!="serigrafia")
{
$stampa=$stampa." :Preventivo";
}
$totale=$prezzo*$quantita;
$iva=$totale*0.2;
$tot=$totale+$iva;

$tot1=$tot1+$tot;
?>
<tr>
<td><?php echo $id_prod; ?></td>
<td><?php echo $nome;?></td>
<td><?php echo $quantita; ?></td>
</tr>
<?php }
//$Prezzo=mysql_query("select sum(totale) as Prezzo from carrello where ip='$ip' ");
//$Prezzo1=mysql_result($query,"totale")
?>

<tr>
<td colspan="3" align="right"></td>
</tr>
<tr>
<td colspan="3" align="right" bgcolor="#FFFF00"></td>
</tr>
</table>



mail($destinatario, $oggetto, $messaggio, $mittente);
?>