1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| CREATE OR REPLACE PROCEDURE Envoie_message
(destinataire IN VARCHAR2,
sujet IN VARCHAR2,
message IN VARCHAR2)
IS
mailhost VARCHAR2(30):='adresse ip du serveur';
mail_conn utl_smtp.connection;
crlf VARCHAR2(30):=CHR(13)||CHR(10);
mesg VARCHAR2(1000);
BEGIN
mail_conn:=utl_smtp.open_connection(mailhost,100);
mesg:='Date: '||TO_CHAR(SYSDATE, 'Mon yy hh24 dd: mi: ss')||crlf||
'De: <'||'relevecptbcc@bcc-bank.com'||'> '||crlf||
'Objet:'||sujet||crlf||
'To: '||destinataire||crlf||''||message;
utl_smtp.helo (mail_conn, mailhost);
utl_smtp.mail (mail_conn, 'relevecptbcc@bcc-bank.com');
utl_smtp.rcpt (mail_conn, destinataire);
utl_smtp.data (mail_conn, mesg);
utl_smtp.quit (mail_conn);
END;
/ |
Partager