I'm doing a forms to send email, and it causes this error, ORA-29278. I researched the internet and the only thing I found was "Transient Error of SMTP: 421 Service Not available". What would this error be? That the SMTP server was not found?
PROCEDURE ENVIA_EMAIL(p_mailhost IN VARCHAR2,
p_sender IN VARCHAR2,
p_recipient IN VARCHAR2,
p_subject IN VARCHAR2,
p_message IN VARCHAR2 ) IS
mail_conn UTL_SMTP.CONNECTION;
crlf VARCHAR2( 2 ) := CHR( 13 ) || CHR( 10 );
mesg VARCHAR2( 5000 );
BEGIN
mail_conn := UTL_SMTP.OPEN_CONNECTION( p_mailhost, 25 );
mesg:= 'Date: ' || TO_CHAR( SYSDATE, 'dd Mon yy hh24:mi:ss' ) || crlf ||
'From: <' || p_sender || '>' || crlf ||
'Subject: ' || p_subject || crlf ||
'To: ' || p_recipient || crlf || '' || crlf || p_message;
UTL_SMTP.HELO( mail_conn, p_mailhost );
--esse trecho foi um código de autenticação que eu achei na internet, não sei se está certo.
utl_smtp.command (mail_conn, 'AUTH LOGIN');
utl_smtp.command (mail_conn,utl_raw.cast_to_varchar2(utl_encode.base64_encode(utl_raw.cast_to_raw('usuario'))));
utl_smtp.command (mail_conn,utl_raw.cast_to_varchar2(utl_encode.base64_encode(utl_raw.cast_to_raw('senha'))));
--fim do trecho de autenticação
UTL_SMTP.MAIL( mail_conn, p_sender );
UTL_SMTP.RCPT( mail_conn, p_recipient);
UTL_SMTP.DATA( mail_conn, mesg );
UTL_SMTP.QUIT( mail_conn );
END;
From now on, thank you.