Difference between revisions of "Email Notification Configuration"
Jump to navigation
Jump to search
Line 65: | Line 65: | ||
To verify the above script is successfully executed; | To verify the above script is successfully executed; | ||
<pre> | <pre> | ||
− | SELECT * FROM | + | SELECT * FROM DBA_NETWORK_ACLS; |
− | SELECT * FROM | + | SELECT * FROM DBA_NETWORK_ACL_PRIVILEGES; |
− | SELECT * FROM user_network_acl_privileges ; | + | SELECT * FROM user_network_acl_privileges; |
</pre> | </pre> | ||
Revision as of 11:45, 23 January 2018
Connect Sys user with SYSDBA rights and execute following
GRANT EXECUTE ON UTL_HTTP to &db_user; GRANT EXECUTE ON UTL_TCP to &db_user; GRANT EXECUTE ON UTL_SMTP to &db_user; GRANT EXECUTE ON UTL_INADDR to &db_user;
Connect Sys user with SYSDBA rights and execute following
begin dbms_network_acl_admin.create_acl ( acl => 'email_sending.xml', description => 'Send Email', principal => '&db_user', is_grant => TRUE, privilege => 'connect', start_date => SYSTIMESTAMP, end_date => NULL ); commit; end; / begin dbms_network_acl_admin.add_privilege ( acl => 'email_sending.xml', principal => '&db_user', is_grant => TRUE, privilege => 'connect' ); commit; end; / begin dbms_network_acl_admin.assign_acl( acl => 'email_sending.xml', host => '*', lower_port => 80, upper_port => 80 ); commit; end; /
Test it using below;
BEGIN SET_SEND_EMAIL_PKG.SEND_EMAIL('yourname@gmail.com', NULL, GET_SYS_DEFAULT('EMAIL_SERVER_IP'), GET_SYS_DEFAULT('EMAIL_SERVER_PORT'), GET_SYS_DEFAULT('EMAIL_FROM'), 'Test Subject', 'Test Message', NULL, NULL, NULL); END;
To verify the above script is successfully executed;
SELECT * FROM DBA_NETWORK_ACLS; SELECT * FROM DBA_NETWORK_ACL_PRIVILEGES; SELECT * FROM user_network_acl_privileges;
Note:
- Where “host” is the IP of the Email Server (‘*’ means auto find the specific email server)
- Where “principal” is the Schema / Database Username where import the database