2013-04-05 17 views
3

我使用的HTML表單的textarea和PHP發送電子郵件中的HTML鏈接使用我的網站發送由PHP

我怎樣才能把一個鏈接在郵件正文發送電子郵件。我這樣做

<a href="http://www.xxxxx.com/">Visit the site</a> 

但我收到全文。我也試過

<html> 
    <head> 
    <title>Test</title> 
    </head> 
    <body> 
    <a href="http://www.xxxxx.com/">Visit the site</a> 
    </body> 
</html> 

但我收到全文

+0

讓我們知道你在寫什麼代碼發送電子郵件 – Mahendra 2013-04-05 05:07:42

+0

哪裏是發送電子郵件的代碼? – 2013-04-05 05:17:04

回答

3

確保你添加頁眉正確

// 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"; 

查閱Example #4 Sending HTML email

0

你有沒有嘗試內設置的內容類型聲明郵件標題發送到郵件服務器?

Content-Type:text/html;字符集= UTF-8

0

套頭到text/html

$headers = "MIME-Version: 1.0" . "\r\n"; 
$headers .= "Content-type:text/html;charset=iso-8859-1"; 

看到的例子:PHP mail() function

0

的問題肯定是在你的頭

$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n"; 

與這些標題,你的內容將被正確解釋。

看看here