Welcome to Egypt Forums Mark forums read | Egypt Main Page
Egypt Forums
Arabic Movies



Articles Thread, Oracle Procedures Send Email Tutorial in Oracle; Oracle Procedures Send Email Tutorial This is a post to share that how to sending out email by using oracle ...

Short Link: http://forum.egypt.com/enforum/showthread.php?t=6973


Reply
LinkBack Thread Tools Display Modes
Oracle Procedures Send Email Tutorial
 
 
The God Father
Developer's Avatar

Reply With Quote
 
Join Date: Jul 2008
Location: NDC
Posts: 5,425
04-12-2008, 02:06 AM
 
Oracle Procedures Send Email Tutorial


This is a post to share that how to sending out email by using oracle procedures. Some of the time. As a developer, I would like this receive some notification email from my procedures, so that I could know that the procedures is running & how many records had been update/inserted.

Below is the same procedures coding.
CREATE OR REPLACE
PROCEDURE TEST
AS
l_mailhost VARCHAR2(64) := ‘
‘;
l_from VARCHAR2(64) := ‘XXXXX’;
l_to VARCHAR2(64) := ‘XXXXX’;
l_mail_conn UTL_SMTP.connection;

BEGIN
l_mail_conn := UTL_SMTP.open_connection(l_mailhost, 25);
UTL_SMTP.helo(l_mail_conn, l_mailhost);

– For Authenication
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(’
USERNAME’)
)
));
UTL_SMTP.command(l_mail_conn, UTL_RAW.CAST_TO_VARCHAR2(
UTL_ENCODE.BASE64_ENCODE(
UTL_RAW.CAST_TO_RAW(’PASSWORD
‘)
)
));
– For Authenication

UTL_SMTP.mail(l_mail_conn, l_from);
UTL_SMTP.rcpt(l_mail_conn, l_to);

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, ‘From: ‘ || l_from || utl_tcp.CRLF);
UTL_SMTP.write_data(l_mail_conn, ‘Subject: ‘ || ‘test’ || utl_tcp.CRLF);
UTL_SMTP.write_data(l_mail_conn, ‘To: ‘ || l_to || utl_tcp.CRLF);
UTL_SMTP.write_data(l_mail_conn, ” || utl_tcp.CRLF);

UTL_SMTP.write_data(l_mail_conn, ‘test’);
UTL_SMTP.close_data(l_mail_conn);
UTL_SMTP.quit(l_mail_conn);
END TEST;
__________________
I Love Walking In The Rain Cuz Nobody Know I'm Crying !!
 
 
 
Reply

Articles Thread, Oracle Procedures Send Email Tutorial in Oracle; Oracle Procedures Send Email Tutorial This is a post to share that how to sending out email by using oracle ...

Short Link: http://forum.egypt.com/enforum/showthread.php?t=6973


Bookmarks

Tags
email, oracle, procedures, send, tutorial


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Oracle/Java Tutorial Developer Articles 2 11-03-2009 04:07 PM
Oracle DBA FAQ - Loading and Exporting Data Tutorial Developer Articles 0 04-12-2008 02:36 AM
Oracle HTML output Tutorial Developer Articles 0 04-12-2008 02:25 AM
Oracle PL/SQL Tutorial Developer Articles 0 04-12-2008 02:09 AM
Send HTML email via adminCP Developer Mods for 3.7.x 0 22-09-2008 04:04 AM