2012-02-21 24 views

回答

7

假設特殊字符是unicode字符,您必須將字符串編碼爲base64格式並在主題行中使用該字符。與此類似,

<cfset strSubject="Demande d’chantillons supplémentaires"> 
<cfset strSubject=ToBase64(strSubject, "utf-8")> 

<cfmail from="[email protected]" to="[email protected]" subject="=?utf-8?B?#strSubject#?=" type="html"> 
    #testText# 
</cfmail> 

主題行必須在格式=?<charset>?<encoding>?<encoded text>?=

?=是必需的。

MIME - Encoded Word

字符集」 可以與IANA註冊的字符集。通常, 它將與消息正文具有相同的字符集。

編碼」可以是「Q」表示Q-編碼或者是類似於 到引用-可打印的編碼,或「B」表示base64編碼。

編碼文本」是Q編碼或base64編碼的文本。

+0

非常感謝,它的作品 – Arasu 2012-02-21 10:05:01

+0

很酷的解決方案。這裏是wiki條目解釋這個http://en.wikipedia.org/wiki/MIME#Encoded-Word – 2014-01-30 11:17:33

0

另外:將charset =「utf-8」添加到cfmail標籤。如果你在主題中使用utf-8,你可能也會在主體中使用它。