APEX_MAIL.SEND函数无法正常运行,但未给出任何错误 [英] APEX_MAIL.SEND function not working though its not giving any error

查看:166
本文介绍了APEX_MAIL.SEND函数无法正常运行,但未给出任何错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

必须使用APEX_MAIL.SEND()方法从 oracle apex 发送电子邮件.

Have to send email from oracle apex using APEX_MAIL.SEND() method.

我正在使用代码:

BEGIN

 apex_mail.send(p_to   => 'tanmoydawn@gmail.com'/*l_to_addr*/,        
                 p_from => 'tanmoydawn@gmail.com'/*l_from_addr*/,
                 p_bcc  => l_bcc_addr,
                 p_subj => l_mail_sub,
                 p_body => 'Service Request ' || :mail_body ||
'Note:- This is a system generated Email. Please DO NOT REPLY to it.');

apex_mail.push_queue;  

EXCEPTION

  when others then    
       INSERT INTO send_mail_error_test VALUES ('Send_mail',systimestamp,:service_request_id||'-err:'||seq_service_req_error_id.NEXTVAL);  

COMMIT;  

END;

***所有变量均包含正确的值

*** all the variables contain correct values

  1. 使用数据库并且该数据库具有ACL(访问控制列表)访问权限

  1. Working with a database and that database has ACL(access control list) access

在apex管理服务中,启用了将电子邮件配置为主机名,端口,电子邮件配置的实例设置.

In apex administrative services, Configured instance settings for email as hostname, port , email provisioning enabled.

已安装UTL_SMTP软件包

UTL_SMTP package is installed

在相同的过程中,在相同的控制流处,尽管apex_mail.send()无法正常工作,但是使用utl_Smtp发送邮件的代码仍然可以正常工作.

From the same process, at the same point of control flow a code to send mail using utl_Smtp is working fine, though that apex_mail.send() is not working.

apex_mail.send()没有给出任何错误或异常,但我没有收到它的电子邮件.

That apex_mail.send() is not giving any error or exception, but i am not recieving email from it.

有些困惑,得到了一些类似的解决方案,应该在ACL 中添加'APEX_040200'.但是我正在使用并在其上实现代码的数据库,比如说apex_user已经添加到了ACL中.即使现在我是否必须在ACL上添加'APEX_040200'或'APEX_050200'?

Have one confusion, got some solutions like that, 'APEX_040200' should have been added to ACL. But the database I am using and implementing the code on it, say 'apex_user' is already added to ACL. Even now do I have to add 'APEX_040200' or 'APEX_050200' to ACL?

有人可以帮助我,给我一个富有成果的解决方案吗?我正在使用apex 5.0.2.00.07.

can anyone help me out and give me a fruitful solution? I am using apex 5.0.2.00.07.

推荐答案

可以在

在可以从Application Builder应用程序发送电子邮件之前,您必须 必须:

Before you can send email from an Application Builder application, you must:

  1. 登录到Oracle Application Express管理服务,然后 在实例设置"页面上配置电子邮件设置.看 《 Oracle Application Express管理指南》中的配置电子邮件".

  1. Log in to Oracle Application Express Administration Services and configure the email settings on the Instance Settings page. See "Configuring Email" in Oracle Application Express Administration Guide.

如果将Oracle Application Express与Oracle Database 11g一起运行 在发行版1(11.1)中,必须启用出站邮件.在Oracle数据库中 在11g第1版(11.1)中,与网络服务进行交互的能力是 默认禁用.请参阅在Oracle数据库中启用网络服务 《 Oracle Application Express应用程序构建器用户指南》中的"11g".

If you are running Oracle Application Express with Oracle Database 11g release 1 (11.1), you must enable outbound mail. In Oracle Database 11g release 1 (11.1), the ability to interact with network services is disabled by default. See "Enabling Network Services in Oracle Database 11g" in Oracle Application Express Application Builder User's Guide.

您指定的实例设置没问题.您的数据库具有ALC访问权限"没有任何意义.您是说您有一个使用网络ACL的数据库? (11克或更高) 相同的文档链接到在Oracle数据库中启用网络服务11g或更高版本"文档

You specified instance settings are ok. Your "database has ALC access" doesn't mean anything. Do you mean you have a database which uses network ACLs? (11g or higher) That same documentation links to "the Enabling Network Services in Oracle Database 11g or Later" documentation

此文档不会让您猜测:

默认情况下,与网络服务交互的功能被禁用 在Oracle Database 11g第1版或第2版或更高版本中.因此,如果您是 在Oracle Database 11g第1版中运行Oracle Application Express 或2或更高版本,您必须使用新的DBMS_NETWORK_ACL_ADMIN包来 向 APEX_050000 数据库的任何主机授予连接权限 用户.无法授予这些特权会导致以下问题:...

By default, the ability to interact with network services is disabled in Oracle Database 11g Release 1 or 2 or later. Therefore, if you are running Oracle Application Express with Oracle Database 11g Release 1 or 2 or later, you must use the new DBMS_NETWORK_ACL_ADMIN package to grant connect privileges to any host for the APEX_050000 database user. Failing to grant these privileges results in issues with:...

如果您有apex的旧版本,例如4.2,则要授予的用户是另一个,可以在文档中找到.或者,您可以找出 例如,通过查询ALL_USERS视图并找到APEX_######用户,选择具有最高版本号的用户:

If you have an older version of apex, eg 4.2, the user to grant to is another one, and can be found in the documentation. Alternatively, you can just find out by for example querying the ALL_USERS view and find the APEX_###### users, pick the one with the highest version number:

select *
from all_users
where username like 'APEX%'
order by username;

这篇关于APEX_MAIL.SEND函数无法正常运行,但未给出任何错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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