【Vegas原创】Oracle使用自带的UTL_MAIL发送邮件

1年前 (2022) 程序员胖胖胖虎阿
173 0 0

Steps to enable Mailing from Database

1.

sqlplus ‘/ as sysdba’

 

2.

SQL>@$ORACLE_HOME/rdbms/admin/utlmail.sql

 

3.

SQL>@$ORACLE_HOME/rdbms/admin/prvtmail.plb

4. Set smtp_server information in init.ora or spfile.ora

SQL>alter system set smtp_out_server = "******";

 

 

How to send an email

1,

sqlplus ‘/ as sysdba’

 

2,

execute  UTL_MAIL.SEND('***@***.**','***@***.**','','','Subject','Content');

 

if want to send an HTML Mail,then:

execute  UTL_MAIL.SEND('***@***.**','***@***.**','','','Subject','Content','text/html; charset=GB2312',3);

 

 

How to grant execute permission to Other Users

 

1,

sqlplus ‘/ as sysdba’

 

2,

 grant execute on sys.UTL_MAIL to whs;

 

3,Login as "whs",execute the same SQL with step2 on How to send an email Paragraph.

 

 

版权声明:程序员胖胖胖虎阿 发表于 2022年11月13日 上午10:32。
转载请注明:【Vegas原创】Oracle使用自带的UTL_MAIL发送邮件 | 胖虎的工具箱-编程导航

相关文章

暂无评论

暂无评论...