語境:我試圖與Oracle程序(僅HTML /文本,而不是純文本/)發送郵件。 我使用Oracle 9i。Oracle9i中發送HTML電子郵件爲特定的字符
問題:當HTML消息包含像& eacute一些字符;(é),它忽略它,它只寫;。 但是,當我在HTML郵件直接é寫,它發送ê至極更好。
實例:
消息發送:
l_html := '<html>
<head><title>Test HTML message</title></head>
<p>trying à with accent : à</p>
<p>trying HTML encoding of foreign language characters : à
</body>
</html>';
消息接收:
trying a with accent : a
trying HTML encoding of foreign language characters : ;
是否有可能既變換到相同的後來的 「一」 或「à 「使用Oracle 9i?
一些代碼,我使用:
l_boundary CONSTANT VARCHAR2(255) DEFAULT 'a1b2c3d4e3f2g1';
l_temp := l_temp || 'MIME-Version: 1.0' || carriageReturn;
l_temp := l_temp || 'To: ' || p_to || carriageReturn;
l_temp := l_temp || 'Cc: ' || p_cc || carriageReturn;
l_temp := l_temp || 'From: ' || p_from || carriageReturn;
l_temp := l_temp || 'Subject: ' || p_subject || carriageReturn;
l_temp := l_temp || 'Reply-To: ' || p_from || carriageReturn;
l_temp := l_temp || 'Content-Type: multipart/alternative; boundary=' || CHR(34) || l_boundary || CHR(34) || carriageReturn;
-- Write the HTML boundary
l_temp := carriageReturn || carriageReturn || '--' || l_boundary || carriageReturn;
l_temp := l_temp || 'content-type: text/html; charset=windows-1252' || carriageReturn || carriageReturn;
l_offset := dbms_lob.getlength(l_body_html) + 1;
dbms_lob.WRITE(l_body_html, LENGTH(l_temp), l_offset, l_temp);
有人能幫助我嗎?
感謝您的快速回復。實際上,我們數據庫的字符集不是windows-1252,它是WE8ISO8859P1。順便說一句,我不能使用UTL_I18N查詢,我有一個執行錯誤** ORA-00904:「UTL_I18N」。「MAP_CHARSET」:identicateur non valide **。 Thie遷移是懸而未決,但我需要找到一個解決方案之前,該遷移完成^^ – nbadaud
順便說一下,當我使用**的charset = WE8ISO8859P1 **,我的例子電子郵件發送** $ eacute; **,而不是* * **。它不能解決我的問題:/ – nbadaud
它應該是'charset = ISO-8859-1'。 'WE8ISO8859P1'是Oracle字符集名稱,您必須使用IANA名稱。 –