我有一個奇怪的問題與PHP郵件和交流。當我使用簡單的php html郵件標記時,請參閱下面的內容(可以在互聯網上找到)我在Microsoft Exchange中將郵件視爲純文本郵件(見下文)。但是,當我使用Outlook將郵件發送到其他帳戶時,我會將郵件視爲HTML郵件。PHP郵件功能與html沒有顯示正確的交換
有沒有人有線索?
Mailscript:
<?php
// multiple recipients
$to = '[email protected]' . ', '; // note the comma
$to .= '[email protected]';
// subject
$subject = 'Birthday Reminders for August';
// message
$message = '
<html>
<head>
<title>Birthday Reminders for August</title>
</head>
<body>
<p>Here are the birthdays upcoming in August!</p>
<table>
<tr>
<th>Person</th><th>Day</th><th>Month</th><th>Year</th>
</tr>
<tr>
<td>Joe</td><td>3rd</td><td>August</td><td>1970</td>
</tr>
<tr>
<td>Sally</td><td>17th</td><td>August</td><td>1973</td>
</tr>
</table>
</body>
</html>
';
// To send HTML mail, the Content-type header must be set
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
// Additional headers
$headers .= 'To: Mary <[email protected]>, Kelly <[email protected]>' . "\r\n";
$headers .= 'From: Birthday Reminder <[email protected]>' . "\r\n";
$headers .= 'Cc: [email protected]' . "\r\n";
$headers .= 'Bcc: [email protected]' . "\r\n";
// Mail it
mail($to, $subject, $message, $headers);
?>
查看在Exchange:
Content-type: text/html; charset=iso-8859-1
From: Birthday Reminder <[email protected]>
Subject:Birthday Reminders for August
Return-Path: [email protected]
X-OriginalArrivalTime: 06 Oct 2010 13:39:59.0117 (UTC) FILETIME=[F839FBD0:01CB655B]
<html>
<head>
<title>Birthday Reminders for August</title>
</head>
<body>
<p>Here are the birthdays upcoming in August!</p>
<table>
<tr>
<th>Person</th><th>Day</th><th>Month</th><th>Year</th>
</tr>
<tr>
<td>Joe</td><td>3rd</td><td>August</td><td>1970</td>
</tr>
<tr>
<td>Sally</td><td>17th</td><td>August</td><td>1973</td>
</tr>
</table>
</body>
</html>
你解決這個問題了嗎? – 2010-10-07 17:48:08