<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);
<?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);
$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>';
?>这个不难理解吧?
要想让客户端识别html,需要在mime设置Content-Type为text/html如果你不是很熟悉,推荐用phpmailer,这个支持发送html邮件.
直接发送HTML内容就可以了。