utl-mail

How Can I Send Emails in PL/SQL (Oracle)?

橙三吉。 提交于 2021-01-29 06:44:06
问题 I have a procedure which count the number of rows in SMS_OUTBOX table and send emails if its row cont is over 1000. My procedure is given below: CREATE OR REPLACE PROCEDURE SEND_EMAIL_ABOUT_PENDING_SMS IS CHECK_SMS_COUNT NUMBER := 1000; CURRENT_SMS_COUNT NUMBER; BEGIN SELECT COUNT(1) INTO CURRENT_SMS_COUNT FROM SMS_SCHEMA.SMS_OUTBOX; IF CURRENT_SMS_COUNT >= CHECK_SMS_COUNT THEN UTL_MAIL.SEND( sender=>'<SENDER_EMAIL>', recipients=>'<RECIPIENT_EMAIL>', subject=>'Pending SMS', Message=>'Pending