我有几个简单的表单可以发送仅包含 html 的电子邮件。大多数客户端(Gmail、Lotus Notes 8、hotmail/live、windows live mail、outlook express)都可以正常接收电子邮件,但 Outlook 2007 不能。
代码如下所示:
$data="
<html>
<body>
<strong><u>$sub</u></strong><br><br>
<strong>Name:</strong> {$_POST["nombre"]}<br><br>
<strong>Phone:</strong>{$_POST["telefono"]}<br><br>
<strong>Email:</strong> {$_POST["email"]}<br><br>
<strong>Subject:</strong> {$_POST["asunto"]}<br><br>
<strong>Question:</strong> {$_POST["consulta"]}</strong>
</body>
</html>";
$header = "Reply-To: $from\r\n";
$header .= "From: \"".$_POST["nombre"]."\" <$from>\r\n";
$header .= "MIME-Version: 1.0\r\n";
$header .= "Content-Type: text/html; charset=iso-8859-1\r\n";
$enviado = mail($destino,$sub,$data,$header);
($from
是消息的唯一验证部分)
客户收到的消息如下所示:
Content-Type: text/html; charset=iso-8859-1
From: Consulta de "Boss" <boss@myfirm.com>
Reply-To: boss@myfirm.com
X-Mailer: PHP/
<strong><u>Solicitud de envío de recetas -
CLIENT</u></strong><br><br><strong>Nombre y Apellido:</strong>
Boss<br><br><strong>Email:</strong>
boss@myfirm.com<br><br><br>
有任何想法吗?