plsql - PL/SQL sending email through a SSL enabled smtp server -
i struggling send mail plsql. using following code. hitting 1 or other error. can plz provide pointers ?
l_mail_conn := utl_smtp.open_connection( host => l_smtp_host, port => l_smtp_port, wallet_path => l_wallet_path, wallet_password => l_wallet_password, secure_connection_before_smtp => false); utl_smtp.ehlo(l_mail_conn, l_smtp_host); -- utl_smtp.starttls(l_mail_conn); // if enable line, "503 5.5.2 send hello first" error -- utl_smtp.command( l_mail_conn, 'auth login'); // tried approach same unrecognized authentication type -- utl_smtp.command( l_mail_conn, l_mail_username_encoded); -- utl_smtp.command( l_mail_conn, l_mail_password_encoded); utl_smtp.auth(l_mail_conn,l_mail_username,l_mail_password,utl_smtp.all_schemes); utl_smtp.mail(l_mail_conn, p_from); process_recipients(l_mail_conn, p_to); process_recipients(l_mail_conn, p_cc); process_recipients(l_mail_conn, p_bcc); utl_smtp.open_data(l_mail_conn); utl_smtp.write_data(l_mail_conn, 'date: ' || to_char(sysdate, 'dd-mon-yyyy hh24:mi:ss') || utl_tcp.crlf); utl_smtp.write_data(l_mail_conn, 'to: ' || p_to || utl_tcp.crlf); if trim(p_cc) not null utl_smtp.write_data(l_mail_conn, 'cc: ' || replace(p_cc, ',', ';') || utl_tcp.crlf); end if; if trim(p_bcc) not null utl_smtp.write_data(l_mail_conn, 'bcc: ' || replace(p_bcc, ',', ';') || utl_tcp.crlf); end if; utl_smtp.write_data(l_mail_conn, 'from: ' || p_from || utl_tcp.crlf); utl_smtp.write_data(l_mail_conn, 'subject: ' || p_subject || utl_tcp.crlf); utl_smtp.write_data(l_mail_conn, 'reply-to: ' || p_from || utl_tcp.crlf || utl_tcp.crlf); utl_smtp.write_data(l_mail_conn, p_message || utl_tcp.crlf || utl_tcp.crlf); utl_smtp.close_data(l_mail_conn); utl_smtp.quit(l_mail_conn);
i hitting error - unrecognized authentication type . have configured oracle wallet , necessary acls.
i using oracle 12c db. there better way of sending mails utl_smtp ??
Comments
Post a Comment