我使用以下代码处理php-html电子邮件:
$to = $email;
$subject = 'ABC';
$message = $content;
$headers = "MIME-Version: 1.0rn";
$headers .= "Content-type: text/html; charset=iso-8859-1rn";
$headers .= 'From: ABC <a@b.com>'."rn";
mail($to, $subject, $message, $headers); // Send our email
其中
$content='<html>
<head>
<title>Thanks</title>
</head>
<body>
<div>
<b>Thanks for your email</b>
</div>
</body>
</html>'
现在收到的电子邮件包含:
rn rn rn rn
rn
rn Thanks for your emailrn
rn
rn
我已经读了几个例子,就标题的格式而言,我并没有做错什么。无法识别问题,帮助?此外,任何关于实施电子通讯的帮助建议都将是有益的。
首先,在HTML格式的邮件中不需要使用<Head>
标记。
试试这个:
$content = '<html><body>';
$content .='<div><b>Thanks for your email</b></div>';
$content .='</body></html>';
或者这个:
$content = "
<html>
<body>
<div>
<b>Thanks for your email</b>
</div>
</body>
</html>";
他们中的一个会成功的
可能是nr
,被解释为编码HTML文本。。因此,使用html标记<br>
,请参阅以获取n