Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

sending html mails using utl_mail

user13103775Jun 13 2014 — edited Jun 14 2014

All,

I am using following procedure to sent out the mail. here , the output sent by the mail is not formatted and there is less clarity reading out the output. here, I am looking out , if I can modify this and sent out the output in html format using the utl_mail or using some of the format tags to make it look appear more clear.

CREATE OR REPLACE PROCEDURE object_created AS

CURSOR driver IS -- find all employees not in a department

SELECT owner , object_name , object_type from dba_objects where to_date(created)='13-JUN-14';

buffer CLOB := null; -- the e-mail message

BEGIN

FOR rec IN driver LOOP -- generate the e-mail message

buffer := buffer ||

rec.owner || ' ' ||

rec.object_name  || ', ' ||

rec.object_type  || chr(10);

END LOOP;

-- Send the e-mail

-- IF buffer is not null THEN -- there are employees without a department

buffer := 'Owner  ' || 'object_name ' || 'object_type ' || CHR(10) || buffer;

UTL_MAIL.SEND (

SENDER=>'abc@abc.com',

RECIPIENTS=>'abc@abc.com',

SUBJECT=>'Object Created',

MESSAGE=>buffer);

--END IF;

END;

/

output

Owner  object_name object_type

GMW1 PKG_GMW_GCS_INTEGRATION, PACKAGE BODY

GMW1 PKG_GMW_IMW_INTEGRATION, PACKAGE BODY

GMW1 PKG_GMW_PDS_INTEGRATION, PACKAGE BODY

GMW1 PKG_GMW_PROD_SITE_MST, PACKAGE BODY

GMW1 PKG_GMW_TLM_INTEGRATION, PACKAGE BODY

GMW1 SP_PRG_ELE_TASK_BY_ELE_CREATE, PROCEDURE

SYS UTL_MAIL, PACKAGE

Regards

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 12 2014
Added on Jun 13 2014
11 comments
11,095 views