oracle - Oracle pl/sql 电子邮件中的特殊字符

标签 oracle email plsql special-characters

我尝试使用 utl_smtp 和 Oracle 发送包含挪威字符 (å æ ø) 的电子邮件。否则,这些字符会在数据库中正确存储和显示,但在电子邮件中显示为问号。

我的数据库字符集是WE8MSWIN1252

我在电子邮件中尝试了不同的 Content-Type mime header ,包括“text/plain;” charset="win-1252"',这似乎没有帮助。

最佳答案

默认情况下,smtp 是 7 位 ascii(有点旧技术:)。您必须使用 UTL_SMTP.write_data 并来自 documentation :

Text (VARCHAR2) data sent using WRITE_DATA is converted to US7ASCII before it is sent. If the text contains multibyte characters, each multibyte character in the text that cannot be converted to US7ASCII is replaced by a '?' character. If 8BITMIME extension is negotiated with the SMTP server using the EHLO subprogram, multibyte VARCHAR2 data can be sent by first converting the text to RAW using the UTL_RAW package, and then sending the RAW data using WRITE_RAW_DATA.

有一个sample demo package on OTN显示如何发送多字节电子邮件。

关于oracle - Oracle pl/sql 电子邮件中的特殊字符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1530505/

相关文章:

oracle - Oracle 形式的 FRM-40501

ORACLE - 已授予创建过程但无法创建过程

html - 对于 html 电子邮件,电子邮件预览中显示哪些内容?

sql - 即席查询 Oracle PL/SQL - 面向 SQL Server 开发人员

用于验证两个数据库的 SQL 脚本

sql - 比较 Oracle 中的时间戳

python - 在Django中通过smtp发送邮件

css - 在电子邮件中添加 Google 字体

arrays - 在 Oracle PL/SQL 中声明动态数组

java - 使用字符串生成器或存储过程进行单行选择