#System Administrator

SCRIPT: Send an Email with PL/SQL

Posted by in Oracle EBS
No Comments

Sometimes it’s needed to send an email using PL/SQL. This can be done with few lines of code pasted below. The variables $server.address, $domain, $sender_email, $recipient_email should be replaced with the relevant information. DECLARE l_retVal INTEGER; v_connection UTL_SMTP.connection; BEGIN v_connection := UTL_SMTP.open_connection(‘$server.address’); UTL_SMTP.helo(v_connection, ‘$domain’); UTL_SMTP.mail(v_connection, ‘$sender_email’); UTL_SMTP.rcpt(v_connection, ‘$recipient_email’); UTL_SMTP.open_data(v_connection); UTL_SMTP.write_data(v_connection, ‘From: $sender_email’ || UTL_TCP.crlf); UTL_SMTP.write_data(v_connection, …

Read More →