If u use gmail as mail server, then configuration like
SMTP server: smtp.gmail.com
SMTP username: Your full gmail address (e.g. example@gmail.com)
SMTP password: Your Gmail password
SMTP port: 465
Or if own mail server, then configure like
SMTP server: mail.yourdomain.com or smtp.yourdomain.com
SMTP username: Your full email address (e.g. example@yourdomain.com)
SMTP password: Your email password
SMTP port: 25/26
SMTP server: smtp.gmail.com
SMTP username: Your full gmail address (e.g. example@gmail.com)
SMTP password: Your Gmail password
SMTP port: 465
Or if own mail server, then configure like
SMTP server: mail.yourdomain.com or smtp.yourdomain.com
SMTP username: Your full email address (e.g. example@yourdomain.com)
SMTP password: Your email password
SMTP port: 25/26
DECLARE
l_acl_name VARCHAR2(30) := 'utl_tcp.xml';
l_ftp_server_ip VARCHAR2(20) := 'smtp.gmail.com';
l_ftp_server_name VARCHAR2(20) := 'smtp.gmail.com';
l_username VARCHAR2(30) := 'TEST';
BEGIN
DBMS_NETWORK_ACL_ADMIN.create_acl (
acl => l_acl_name,
description => 'Allow connections using UTL_TCP',
principal => l_username,
is_grant => TRUE,
privilege => 'connect',
start_date => SYSTIMESTAMP,
end_date => NULL);
COMMIT;
DBMS_NETWORK_ACL_ADMIN.add_privilege (
acl => l_acl_name,
principal => l_username,
is_grant => FALSE,
privilege => 'connect',
position => NULL,
start_date => NULL,
end_date => NULL);
COMMIT;
DBMS_NETWORK_ACL_ADMIN.assign_acl (
acl => l_acl_name,
host => l_ftp_server_ip,
lower_port => NULL,
upper_port => NULL);
DBMS_NETWORK_ACL_ADMIN.assign_acl (
acl => l_acl_name,
host => l_ftp_server_name,
lower_port => NULL,
upper_port => NULL);
COMMIT;
END;
Conn sys as sysdba
select * from dba_network_acls;
select * from dba_network_acl_privileges;
select * from apex_mail_queue;
SELECT host, lower_port, upper_port, privilege, status
FROM user_network_acl_privileges;
SELECT * from APEX_MAIL_QUEUE ORDER BY LAST_UPDATED_ON DESC;
SELECT * from APEX_MAIL_LOG ORDER BY LAST_UPDATED_ON DESC;
GRANT EXECUTE ON UTL_SMTP to test;
GRANT EXECUTE ON UTL_TCP to test;
GRANT EXECUTE ON UTL_MAIL to test;
GRANT EXECUTE ON UTL_SMTP to APEX_200100;
GRANT EXECUTE ON UTL_TCP to APEX_200100;
GRANT EXECUTE ON UTL_MAIL to APEX_200100;
SELECT * FROM USER$;
;
SELECT acl,
host,
DECODE(
DBMS_NETWORK_ACL_ADMIN.check_privilege_aclid(aclid, 'TEST', 'connect'),
1, 'GRANTED', 0, 'DENIED', NULL) privilege
FROM dba_network_acls;
BEGIN
DBMS_NETWORK_ACL_ADMIN.drop_acl (
acl => '/sys/acls/power_users.xml');
COMMIT;
END;
/
begin
DBMS_NETWORK_ACL_ADMIN.create_acl(
acl => 'power_users_apex.xml',
description => 'Access to Apex Email',
principal=>'APEX_200100',
IS_GRANT=>TRUE,
PRIVILEGE=>'connect',
START_DATE=>SYSTIMESTAMP,
END_DATE=>NULL);
COMMIT;
end;
/
begin
DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(
acl => 'power_users_apex.xml',
principal=>'APEX_200100',
IS_GRANT=>TRUE,
PRIVILEGE=>'resolve');
COMMIT;
end;
/
begin
DBMS_NETWORK_ACL_ADMIN.assign_acl(
acl => 'power_users_apex.xml',
host=>'smtp.gmail.com',
lower_port=>465,
upper_port=>null);
COMMIT;
end;
/
No comments:
Post a Comment