gmail 仍然显示带有 php mail() 的 html 标签;
gmail still shows html tags with php mail();
我在这个网站和 php.net 网站上查找了我应该使用 php mail() 函数发送哪些标签才能正确发送 html 邮件。不知何故,我的 gmail 仍然显示 html 标签。我做错了什么?
$to = "$email";
$subject = "order placed";
$from = "noreply@snorgytees.tk";
$message = "
Hi, '{$_SESSION['naam']}';
<html>
<head>
</head>
<body>
<table>
<tr>
<td>$Artikelnaam></td>
<td>$maat</td>
<td>$hoeveelheid</td>
<td>$$echteprijs</td>
<td>Total: $$totaalprijs;
<br><br>Total including VAT: $$prijs_btw</td>
</tr>
</table>
</body>
</html>
";
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'To: $_POST["email"]' . "\r\n";
$headers .= 'From: noreply@snorgytees.tk' . "\r\n";
mail($to, $subject, $from, $message, $headers);
大约一周前我遇到了同样的问题,这个帮助我解决了。
gmail does not render html in email
我在这个网站和 php.net 网站上查找了我应该使用 php mail() 函数发送哪些标签才能正确发送 html 邮件。不知何故,我的 gmail 仍然显示 html 标签。我做错了什么?
$to = "$email";
$subject = "order placed";
$from = "noreply@snorgytees.tk";
$message = "
Hi, '{$_SESSION['naam']}';
<html>
<head>
</head>
<body>
<table>
<tr>
<td>$Artikelnaam></td>
<td>$maat</td>
<td>$hoeveelheid</td>
<td>$$echteprijs</td>
<td>Total: $$totaalprijs;
<br><br>Total including VAT: $$prijs_btw</td>
</tr>
</table>
</body>
</html>
";
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'To: $_POST["email"]' . "\r\n";
$headers .= 'From: noreply@snorgytees.tk' . "\r\n";
mail($to, $subject, $from, $message, $headers);
大约一周前我遇到了同样的问题,这个帮助我解决了。 gmail does not render html in email