从Oracle发送电子邮件而不安装XML DB

时间:2016-10-13 11:47:15

标签: oracle stored-procedures

有没有办法在没有安装XML DB的情况下从Oracle发送电子邮件?我无法访问服务器,但我无法安装此服务器。我创建了以下过程,但它要求XML DB。

CREATE OR REPLACE PROCEDURE send_mail (p_to        IN VARCHAR2,
                                       p_from      IN VARCHAR2,
                                       p_message   IN VARCHAR2,
                                       p_smtp_host IN VARCHAR2,
                                       p_smtp_port IN NUMBER DEFAULT 25)
AS
  l_mail_conn   UTL_SMTP.connection;
BEGIN
  l_mail_conn := UTL_SMTP.open_connection(p_smtp_host, p_smtp_port);
  UTL_SMTP.helo(l_mail_conn, p_smtp_host);
  UTL_SMTP.mail(l_mail_conn, p_from);
  UTL_SMTP.rcpt(l_mail_conn, p_to);
  UTL_SMTP.data(l_mail_conn, p_message || UTL_TCP.crlf || UTL_TCP.crlf);
  UTL_SMTP.quit(l_mail_conn);
END;

我在运行此程序时遇到错误

24248. 00000 -  "XML DB extensible security not installed"
*Cause:    XML DB extensible security necessary for this operation has
           not been installed.
*Action:   Ensure that XML DB has been installed.

要完成它还有其他想法吗?

谢谢!

1 个答案:

答案 0 :(得分:1)

如果服务器上安装了UTL_MAIL,则可以使用list

第二个选项请尝试通过Java程序发送:https://community.oracle.com/thread/3628357