This content has been marked as final. Show 2 replies
Unfortunately, there is no way to accomplish this in HTML DB. We can consider this for a future release in HTML DB, but we haven't seen overwhelming demand for it.
About all I can suggest is your own e-mail implementation in PL/SQL (using UTL_SMTP or the new-in-10g UTL_MAIL, although it looks like even UTL_MAIL does not let you provide credentials).
It's possible but I'm not sure if putting an authenticated relay server between HTML DB and the outbound SMTP server would circumvent this.
You can use UTL_SMTP to send mail through a server that requires authentication by sending the authentication commands after connecting. I use a procedure like the one below. I submit it using DBMS_JOB.
CREATE OR REPLACE PROCEDURE "SEND_MAIL" (
p_sender IN VARCHAR2,
p_recipient IN VARCHAR2,
p_message IN VARCHAR2
l_mailhost VARCHAR2 (255) := 'your.outgoing.mailserver.address';
l_mail_conn := UTL_SMTP.open_connection (l_mailhost, 25);
utl_smtp.command( l_mail_conn, 'AUTH LOGIN');
utl_smtp.command( l_mail_conn, utl_raw.cast_to_varchar2( utl_encode.base64_encode( utl_raw.cast_to_raw( 'Your Mail UserName' ))) );
utl_smtp.command( l_mail_conn, utl_raw.cast_to_varchar2( utl_encode.base64_encode( utl_raw.cast_to_raw( 'Your Mail Password' ))) );
UTL_SMTP.helo (l_mail_conn, l_mailhost);
UTL_SMTP.mail (l_mail_conn, p_sender);
UTL_SMTP.rcpt (l_mail_conn, p_recipient);
utl_smtp.write_data(l_mail_conn, 'Subject: Your Subject Line Here');
UTL_SMTP.write_data (l_mail_conn, p_message);