我使用MsgHTML()函数发送此邮件正文。在邮件脚本中启用了isHTML。像
这样的HTML标签可以在邮件中呈现,内联样式也可以。但是这个表格并不是在gmail中呈现的。显示纯文本的收件箱。图像显示清晰。
$pd_details.='
<table >
<th>Prod no |</th> <th>Prod name |</th> <th>Prod price |</th> <th>Prod quantity |</th> <th>Prod image |</th>
<tr><td>'.$c.'</td><td>'.$pname.'</td><td>'.$total.'</td><td>'.$quant.'</td<td>'.$pdimg.'</td></tr>
</table>
Total Price is : '.$sum.' ';
Try this...
$from='sender details';
$to='receiver email address';
$headers .= 'MIME-Version: 1.0' . "'r'n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "'r'n";
$headers .= 'From:'.$from. "'r'n";
$body='<table >
<th>Prod no |</th> <th>Prod name |</th> <th>Prod price |</th> <th>Prod quantity |</th> <th>Prod image |</th>
<tr><td>'.$c.'</td><td>'.$pname.'</td><td>'.$total.'</td><td>'.$quant.'</td<td>'.$pdimg.'</td></tr>
</table>';
$subject="subject";
ini_set("sendmail_from",$from);
@mail($to,$subject,$body,$headers);