{ORACLE_HOME}/rdbms/admin/utlmail.sql
{ORACLE_HOME}/rdbms/admin/prvtmail.plb
Required Object Privilege :
GRANT execute ON utl_mail TO
Initialization Parameter:
SMTP_OUT_SERVER
Göndermek için de;
--the SMTP_OUT_SERVER parameter must be set
SQL> ALTER SYSTEM SET smtp_out_server = 'smtp.drizzle.com'
SCOPE=SPFILE;
SQL> SHUTDOWN IMMEDIATE;
SQL> STARTUP
CREATE OR REPLACE PROCEDURE eblast IS
CURSOR mcur IS
SELECT per_h_email
FROM psoug.person
WHERE per_ok2_email = 'Y'
AND per_h_email IS NOT NULL;
vSender VARCHAR2(30) := 'mailsys@psoug.org';
vSubj VARCHAR2(50) := 'April PSOUG News';
vMesg VARCHAR2(4000);
vMType VARCHAR2(30) := 'text/plain; charset=us-ascii';
BEGIN
SELECT msgcol
INTO vMesg
FROM msg;
FOR mrec IN mcur
LOOP
utl_mail.send(vSender, mrec.per_h_email, NULL, NULL, vSubj,
vMesg, vMType, NULL);
END LOOP;
END eblast;
/
Hiç yorum yok:
Yorum Gönder