在Oracle中发送非常大的HTML消息体



我有下面的一段代码-

declare
msg clob;
begin
select email into msg from ANI_CLOB;
Utl_Mail.Send(Sender =>'<abc.def@xyz.com>', Recipients =>abc.def@xyz.com,subject =>'CLOB MESSAGE', MIME_TYPE => 'text/html', Message =>msg);
end;

ANI_CLOB表有一列"EMAIL",数据类型为CLOB,只有一行存储大型html电子邮件正文。

当我运行这个块时,我得到的错误低于

Error report -
ORA-06502: PL/SQL: numeric or value error
ORA-06512: at line 5
06502. 00000 -  "PL/SQL: numeric or value error%s"
*Cause:    An arithmetic, numeric, string, conversion, or constraint error
occurred. For example, this error occurs if an attempt is made to
assign the value NULL to a variable declared NOT NULL, or if an
attempt is made to assign an integer larger than 99 to a variable
declared NUMBER(2).
*Action:   Change the data, how it is manipulated, or how it is declared so
that values do not violate constraints.

我们可以在utl_mail.send中发送CLOB作为消息体吗。此外,我只想将此消息作为邮件正文发送。

否,UTL_MAIL不支持CLOBs。如果必须这样做,则必须使用UTL_SMTP,自己处理与邮件服务器通信的不同步骤,并使用对utl_smtp.write_data的多次调用发送CLOB

最新更新