Oracle 11g Access Control List Configuration for utl_Smtp and utl_mail
You Must Have XDB Component installed in Your Database..
If not install using below script
@?/rdbms/admin/catqm.sql xdb sysaux temp YES
create acl as below example
Add SMTP server(Mail Relay) details in Create ACL as below
Give access of Created ACL to USERS
After Creating Once Again Give Grant to execute below procedures
UTL_SMTP
UTL_TCP
UTL_HTTP
UTL_MAIL
We Can send mail using both UTL_SMTP and UTL_MAIL packages.
If you want UTL_MAIL Package also
Run below Command to Create UTL_MAIL Package
@?/rdbms/admin/utlmail.sql
and
@?/rdbms/admin/prvtmail.plb
Then
Set "SMTP_OUT_SERVER" to Mail Relay Host as Below
alter system set smtp_out_server='xx.xx.xx.xx' scope=both;
XX.XX.XX.XX is Mail Relay Server IP address.
After Doing all this Now You can send mail from database using both packages UTL_MAIL and UTL_SMTP..
Create Required Procedure to Send a Mail.
For Example:
Execute The Procedure To send a test mail
No comments:
Post a Comment