<table border="1" cellpadding="0" cellspacing="0">
      <?php do { ?>
        <td ><?php echo $row_carRec['goods_name']; ?></td>
          <td >$<?php echo $row_carRec['goods_price']; ?></td>         
          <?php } while ($row_showitemRec = mysql_fetch_assoc($showitemRec)); ?>
    </table>上面table格式可以怎放進body$headers = "Content-Type: text/html; charset=UTF-8";
$body="table格式";
mail($_POST['ord_email'],"你好",$body,$headers);

解决方案 »

  1.   

    <?php
    $body ='<table border="1" cellpadding="0" cellspacing="0">';
    do { 
            $body .= "<td >{$row_carRec['goods_name']}</td>";
            $body.="<td >${$row_carRec['goods_price']}</td>";
    } while ($row_showitemRec = mysql_fetch_assoc($showitemRec));
    $body .=  '</table>';
    ?>这个不难理解吧?
      

  2.   

    直接发送表格字符串是不会被显示成表格的,只是当普通的字符串处理.
    要想让客户端识别html,需要在mime设置Content-Type为text/html如果你不是很熟悉,推荐用phpmailer,这个支持发送html邮件.
      

  3.   

    phpmailer +1http://phpmailer.codeworxtech.com/index.php?pg=examples
      

  4.   

    头信息设定HTML,
    直接发送HTML内容就可以了。