0
我有一些問題,我的PHP郵件程序,我只收到源代碼不interprated。PHP MIME頭
有人可以檢查我的標題?
$recipient = str_replace(Array("\r","\n"),"",$this->to);
$headers = 'From: "xxx.ch" <[email protected]> '."\r\n";
$headers .= 'Return-Path: <[email protected]>' . "\r\n";
if (isset($this->replyTo)){
$headers .= 'Reply-To: [email protected]' . "\r\n";
}
$random_hash = md5(date('r', time()));
$headers .= "MIME-Version: 1.0 \r\n Content-Type: multipart/alternative; boundary=\"".$random_hash."\"";
$body = '--'.$random_hash."\r".'
Content-Type: text/plain; charset="UTF-8"'."\r".'
Content-Transfer-Encoding: 8bit'."\r".'
Merci d\'utiliser un client mail supportant le format HTML'."\r".'
--'.$random_hash."\r".'
Content-Type: text/html; charset="UTF-8"'."\r".'
Content-Transfer-Encoding: 8bit'."\r";
$body .= $this->HTMLBody ."\r".'--'.$random_hash.'--';
感謝
您的服務器設置爲發送電子郵件嗎?什麼SMTP服務正在運行? PHP配置是否正確發送電子郵件? –
是服務器配置是好的,但對於一些舊的郵件客戶端不支持HTML,所以我必須添加對它們的支持,現在用MIME我有很多的錯誤:-( –
你有沒有看過使用PEAR的MIME郵件包 – miken32