无法使用PHPmailer将表格格式发送到gmail。

时间:2014-08-18 03:46:51

标签: php phpmailer

我使用MsgHTML()函数发送此邮件正文。 isMML在邮件程序脚本中启用。 像
这样的HTML标签是用邮件呈现的,Inline风格也有效。 但该表未在gmail中呈现。收件箱显示纯文本。图像清晰显示。

PHP代码

$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.' ';

1 个答案:

答案 0 :(得分:0)

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);