Capturar mensagem ao enviar e-mail

#103060

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);

(...)

plugins premium WordPress