Send Mail Done
Send Mail Done
Disclaimer
Heres a simple solution to send out emails from 10g Database sql prompt.
This solution will be really helpful if the OS utility (mailx, sendmail) is restricted for end
users.
1. sqlplus ‘/ as sysdba’
2. @$ORACLE_HOME/rdbms/admin/utlmail.sql
3. @$ORACLE_HOME/rdbms/admin/prvtmail.plb
4. Set smtp_server information in init.ora or spfile.ora
alter system set smtp_out_server = ‘SMTP_SERVER_IP_ADDRESS:SMTP_PORT’
scope=both;
25 = Default SMTP Port
smtp_out_server = ’172.25.90.165:25′
1. sqlplus ‘/ as sysdba’
2. exec utl_mail.send((sender => ‘[email protected]’, recipients =>
‘[email protected]’, subject => ‘Testing UTL_MAIL Option’, message =>
‘blah blah blah’);
3. Check the inbox of the email id, to verify the email receipt.
To enable other DB users to use this functionality, grant execute permission on
UTL_MAIL package.
cheers,
OraclePitStop.