Hola, me invente cualquier cosa, el while tienes que sustirtuirlo por tu consulta, y le das mas retoques, lo que pedias ya se generó.
Código PHP:
$html="<table>";
$i = 1;
while ($i <= 10) {
$html=$html."<tr>";
$html=$html."<td>$i</td>";
$html=$html."</tr>";
$i++;
}
$html=$html."</table>";
$to = "[email protected]";
$from = "[email protected]";
$subject = "subject";
$body = $html;
$headers="Content-Type:text/html;CHARSET=iso-8859-8-i\r\n";
$headers.="From:".$from."\r\n";
mail($to, $subject, $body, $headers);
Saludos