Store Procude to send an email message out from Oracle 10g

I am trying to use store procedue to read data from Oracle 10g table and send email message out. The store procedue needs to run every 5min and it go thru the table and check the field->SendMail. if it is false/null then send the email outfor that record and update it to true,otherwise go to the next one. I can use SMTP from W2K3 server to send the messge.
I am not sure what needs to be done to make this work, so pls provide some sample if possible.
thanks.

We use a Java stored procedure that calls Javamail. You have to learn how to create stored procedures in your database, then we schedule an overall PL/SQL job from DBMS_SCHEDULER that iterates a table and calls the Java stored procedure with each address / message and receives the status. Sorry I cannot post code here, this is a commercial app, and I don't have time to today to write a sample for you, but just wanted to point you to our approach if it helps.

Please research PL/SQL, Javamail and Java stores procedures in Oracle.

schwertner:
Thank you for your code and it helps a lot.
Questions.
1.Your first code calls the second code. How to make the first code run? just call it once and it repeat running in its FREQ defined in the code.
2. you mentioned to use Java in your first post but I didn't see it in your code. Can you explain it a little bit.
thanks!

The first code SCHEDULES the second code to run weekly.
Read the docs for DBMA_SCHEDULER to change it to run every 5 minutes.
It will automatically invoke the second code.
The second code is AS IS. The package uses Java but behind the stage.
Possibly you can find more up to date PL/SQL scripts to send emails.

I configured the utl_mail in my oracle 10g and when I creating the following AFTER INSERT trigger from SQL Plus worksheet got error "Warning: Trigger created with compilation errors."

Below is my trigger

CREATE OR REPLACE TRIGGER mssg_after_insert
AFTER INSERT
ON mssg_log
FOR EACH ROW
BEGIN
IF (:new.dsc='PM') THEN
INSERT INTO fmax_mssg_log_BK(ent_date,Proposal,trans_num,send_yn,phsdsc)
VALUES
( :new.ent_date,
:new.item,
:new.trans_num,
:new.send_yn,
:new.dsc);
UTL_MAIL.SEND('mymail@yahoo.com','yourmail@yahoo.com',NULL,NULL,'Testing Message','This is a test','text/plain',NULL);
END IF;
END;

Truncate is a DDL Command where as Delete is a DML Command.
Both will delete data from table, but what is the difference between these below statements
truncate table <table_name> ??
delete from <table_name> ??
The first command cannot be …

Introduction
A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…