不顯示我用下面的代碼來發送電子郵件:HTML郵件客戶端Outlook Express中
$to = "****.co.uk";
$subject = "Membership submission";
$body = "";
$date = date('d/m/Y H:i:s');
$body .= "<b>REF</b>: " . $postId . "<br />";
$body .= "<b>On</b>: " . $date . "<br />";
$body .= "<b>First name</b>: " . $postFirstName . "<br />";
$body .= "<b>Last name</b>: " . $postLastName . "<br />";
$body .= "<b>Company name</b>: " . $postCompanyName . "<br />";
$body .= "<b>Address</b>:<br /> " . nl2br($postAddress) . "<br />";
$body .= "<b>Telephone number</b>: " . $postTelephoneNumber . "<br />";
$body .= "<b>Email</b>: " . $postEmail . "<br />";
$body .= "<b>Website</b>: " . $postWebsite . "<br />";
$body .= "<b>Skills</b>:<br /> " . nl2br($postSkills) . "<br />";
$body .= "<b>Payment method</b>: " . $postPaying . "<br />";
// 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 .= 'From: [email protected]*****.co.uk' . "\r\n";
if (mail($to, $subject, $body, $headers)) {
//
在outlook.com和Windows談到通過罰款8郵件程序。 但是,當發送到我的客戶端的桌面Outlook程序涉及通過這樣的:
Content-type: text/html; charset=iso-8859-1
From: [email protected]***
X-Brightmail-Tracker: AAAAAQAAAlk=
<b>REF</b>: 513a8440922ea<br /><b>On</b>: 09/03/2013 00:40:59<br /><b>First
name</b>: a name<br /><b>Last name</b>: a last name<br /><b>Company name</b>: My
Company name<br /><b>Address</b>:<br /> an address,<br />
2,<br />
3,<br />
4,<br />
postcode<br /><b>Telephone number</b>: 521213091<br /><b>Email</b>:
****.co.uk<br /><b>Website</b>: site.com<br
/><b>Skills</b>:<br /> I do not have any skills to assist with.<br />
<br />
Sorry<br /><b>Payment method</b>: Bank transfer<br />
有什麼不對我的代碼?
我只是嘗試添加此:
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
現在我收到outlook.com的電子郵件是唯一的HTML。這樣就殺了它?啊,這裏有什麼問題!
可能重複(http://stackoverflow.com/questions/3058897/sending-html-email-from-php) – j0k 2013-03-09 11:33:01