$cuerpo = "<table id='tabla'>";
$cuerpo .= "<thead><tr><td><strong>N°</strong></td><td><strong>Patente</strong></td><td><strong>Fecha</strong></td><td><strong>Hora</strong></td><td><strong>Calle</strong></td><td><strong>Detalle</strong></td></tr></thead>\n<tbody>";
$registros=mysql_query("SELECT * FROM autos WHERE placa='$placa' AND fecha='$fecha' ORDER BY placa DESC",$link);
while ($row=mysql_fetch_array($registros))
{
$cuerpo .= "<tr>";
$cuerpo .= "<td>$i</td>";
$cuerpo .= "<td>$placa</td>";
$cuerpo .= "<td>$fecha</td>";
$cuerpo .= "<td>$hora</td>";
$cuerpo .= "<td>$calle</td>";
$cuerpo .= "<td>$info</td>";
$cuerpo .= "</tr>\n";
$header ="From:xxx\n";
$header .="X-Mailer:PHP/".phpversion()."\n";
$header .="Mime-Version:1.0\n";
$header .="Content-Type:text/html";
//mail("
[email protected]","Informe diario ".$placa."","$cuerpo","$header") or die ("Su mensaje no se envio.");
} // si dejo esta llave ahi me manda tantos mails como filas
$cuerpo .= "</tbody>";
$cuerpo .= "</table>"; // silo dejo arriba tambien
mail("
[email protected]","Informe diario ".$placa."","$cuerpo","$header") or die ("Su mensaje no se envio."); // me manda la ultima fila de la tabla