Sending Mail from the database

You should have an outgoing SMTP server IP to configure sending mail from the database.
I already put it in the database server /etc/hosts as mailhost

sqlplus / as sysdba
grant execute on UTL_MAIL to public;
ALTER SYSTEM SET smtp_out_server = 'mailhost' scope=both;

a simple example

UTL_MAIL.send(sender => '',
recipients => '',
subject => 'Test Mail',
message => 'Hello World',
mime_type => 'text; charset=us-ascii');

For further advanced options such as attachments see in this wiki


Popular posts from this blog

Fixing & Registering ORACLE_HOMES in Central Inventory

List RMAN backups size

AWR Generating & Setting