Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ionic-framework/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
无法使用PHPmailer将表格格式发送到gmail。_Php_Phpmailer - Fatal编程技术网

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

无法使用PHPmailer将表格格式发送到gmail。,php,phpmailer,Php,Phpmailer,我使用MsgHTML()函数发送此邮件正文。 isHTML在mailer脚本中启用。 类似于的HTML标记在邮件中呈现,内联样式也起作用。 但该表并没有在gmail中呈现。显示纯文本的收件箱。图像显示清晰 PHP代码 $pd_details.=' <table > <th>Prod no |</th> <th>Prod name |</th> <th>Prod price |</th> &l

我使用MsgHTML()函数发送此邮件正文。 isHTML在mailer脚本中启用。 类似于
的HTML标记在邮件中呈现,内联样式也起作用。 但该表并没有在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.' ';
$pd\u详细信息。='
产品编号|产品名称|产品价格|产品数量|产品图片|
“..c.”“..pname.”“..total.”“..quant.”
试试这个。。。
$from='sender details';
$to='receiver email address';
$headers.='MIME版本:1.0'。“\r\n”;
$headers.='内容类型:文本/html;字符集=iso-8859-1'。“\r\n”;
$headers.='From:'。$From。“\r\n”;
$body=
产品编号|产品名称|产品价格|产品数量|产品图片|

“..c.”“..pname.”“..total.”“..quant.”确保整个邮件正文有效html@Dagon这意味着什么??无法理解。是的,也许你有一些html错误,所以gmail无法呈现。@Dagon我不这么认为,伙计。因为其他HTML标题采用换行标记,所以工作正常。正如他所说的!首先,您的
th
s周围缺少一个
tr
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);