14 de março de 2012 às 3:38 am
#103060
Victor Armbrust
Mestre
Tenta usar EXCEPTION:
Exemplo:
(...)
mesg:= 'Date: ' || TO_CHAR( SYSDATE, 'dd Mon yy hh24:mi:ss' ) || crlf ||
'From: ' || crlf ||
'Subject: '||subject || crlf ||
'To: '||recipient || crlf ||
message;
utl_smtp.helo(mail_coNn, mailhost);
utl_smtp.mail(mail_conn, sender);
utl_smtp.rcpt(mail_conn, recipient);
utl_smtp.data(mail_conn, mesg);
utl_smtp.quit(mail_conn);
Exception
WHEN OTHERS THEN
raise_application_error(-20002,'unable to send the mail.'||SQLERRM);
(...)