配置UTL_MAIL软件包先决条件 [英] Configuring UTL_MAIL Package Prerequisites

查看:92
本文介绍了配置UTL_MAIL软件包先决条件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图将系统配置为使用UTL_MAIL软件包发送邮件,但没有运气..我读到我需要首先配置ACL.因此我做到了.但是即使这样做,它仍然无法正常工作.

I was trying to configure my system to send mail using UTL_MAIL package but no luck .. I read that I need to configure ACL first. hence I did. But even doing so it's not working still.

SELECT * FROM dba_network_acls;

begin
  dbms_network_acl_admin.create_acl (
    acl         => 'utl_http.xml',
    description => 'HTTP Access',
    principal   => 'HR',
    is_grant    => TRUE,
    privilege   => 'connect',
    start_date  => null,
    end_date    => null
  );
  dbms_network_acl_admin.add_privilege (
    acl        => 'utl_http.xml',
    principal  => 'HR',
    is_grant   => TRUE,
    privilege  => 'resolve',
    start_date => null,
    end_date   => null
  );
  dbms_network_acl_admin.assign_acl (
    acl        => 'utl_http.xml',
    host       => 'smtp.gmail.com',
    lower_port => 25,  --- Gmail SMTP server.
    upper_port => 25
  );
  commit;
end;
/

我遇到错误

ORA-29279:SMTP永久错误:530 5.7.0必须首先发出STARTTLS命令. ei4sm3659171pbb.42-gsmtp ORA-06512:位于"SYS.UTL_MAIL"的第654行 ORA-06512:位于"SYS.UTL_MAIL"的第671行 ORA-06512:在第2行 29279.00000-"SMTP永久错误:%s" *原因:发生SMTP永久错误. *操作:更正错误,然后重试SMTP操作.

ORA-29279: SMTP permanent error: 530 5.7.0 Must issue a STARTTLS command first. ei4sm3659171pbb.42 - gsmtp ORA-06512: at "SYS.UTL_MAIL", line 654 ORA-06512: at "SYS.UTL_MAIL", line 671 ORA-06512: at line 2 29279. 00000 - "SMTP permanent error: %s" *Cause: A SMTP permanent error occurred. *Action: Correct the error and retry the SMTP operation.

我已经执行了以下命令

CONN sys/password AS SYSDBA

CONN sys/password AS SYSDBA

@ $ ORACLE_HOME/rdbms/admin/utlmail.sql

@$ORACLE_HOME/rdbms/admin/utlmail.sql

@ $ ORACLE_HOME/rdbms/admin/prvtmail.plb

@$ORACLE_HOME/rdbms/admin/prvtmail.plb

请帮助!

推荐答案

您的SMTP服务器似乎需要加密的连接. UTL_MAIL旨在简化用于基本SMTP服务器发送邮件的API.它不支持SMTP协议定义的所有选项集.我不认为它支持TLS.

Your SMTP server appears to require an encrypted connection. UTL_MAIL is designed to simplify the API for sending mail for basic SMTP servers. It doesn't support the full set of options defined by the SMTP protocol. I don't believe it supports TLS.

假设您使用的是11.2,则需要使用UTL_SMTP程序包,并且需要调用

Assuming that you're using 11.2, you'll need to use the UTL_SMTP package and you'll need to call the STARTTLS function while you're setting up the connection.

这篇关于配置UTL_MAIL软件包先决条件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆