Discussions
Categories
- 197K All Categories
- 2.5K Data
- 546 Big Data Appliance
- 1.9K Data Science
- 450.8K Databases
- 221.9K General Database Discussions
- 3.8K Java and JavaScript in the Database
- 31 Multilingual Engine
- 552 MySQL Community Space
- 479 NoSQL Database
- 7.9K Oracle Database Express Edition (XE)
- 3.1K ORDS, SODA & JSON in the Database
- 556 SQLcl
- 4K SQL Developer Data Modeler
- 187.2K SQL & PL/SQL
- 21.4K SQL Developer
- 296.4K Development
- 17 Developer Projects
- 139 Programming Languages
- 293.1K Development Tools
- 110 DevOps
- 3.1K QA/Testing
- 646.1K Java
- 28 Java Learning Subscription
- 37K Database Connectivity
- 161 Java Community Process
- 105 Java 25
- 22.1K Java APIs
- 138.2K Java Development Tools
- 165.3K Java EE (Java Enterprise Edition)
- 19 Java Essentials
- 162 Java 8 Questions
- 86K Java Programming
- 81 Java Puzzle Ball
- 65.1K New To Java
- 1.7K Training / Learning / Certification
- 13.8K Java HotSpot Virtual Machine
- 94.3K Java SE
- 13.8K Java Security
- 205 Java User Groups
- 24 JavaScript - Nashorn
- Programs
- 474 LiveLabs
- 39 Workshops
- 10.2K Software
- 6.7K Berkeley DB Family
- 3.5K JHeadstart
- 5.7K Other Languages
- 2.3K Chinese
- 175 Deutsche Oracle Community
- 1.1K Español
- 1.9K Japanese
- 233 Portuguese
How can I add attachments from rtf report in oracle apex?

Thanks in advance.......
Following is my Apex Page Submit Process in Apex 20.1.
------------------------------------------------------------
DECLARE
l_mailid NUMBER;
l_report BLOB;
BEGIN
BEGIN
l_report :=
APEX_UTIL.get_print_document (
p_application_id => 28062,
p_report_query_name => 'QRERROR',
p_report_layout_name => 'LYTQRERROR',
p_report_layout_type => 'rtf',
p_document_format => 'pdf',
p_print_server => 'https://apex.oracle.com/pls/apex');
EXCEPTION
WHEN OTHERS
THEN
Proc_Ins_Error_Log (SQLCODE, SQLERRM));
END;
BEGIN
INSERT INTO TBL_TEST_BLOB (T_BLOB, T_REMARKS)
VALUES (
l_report,
'Inserted from apex.oracle.com. Date and Time:'
|| TO_CHAR (SYSDATE, ' Mon DD, RRRR HH:MIam'));
COMMIT;
EXCEPTION
WHEN OTHERS
THEN
Proc_Ins_Error_Log (SQLCODE, SQLERRM));
END;
l_mailid :=
APEX_MAIL.SEND (
p_to => '[email protected]',
p_from => '[email protected]',
p_subj => 'APEX_MAIL Apex.Oracle.Com. test subject';
p_body => 'dis is test email.',
p_body_html => '<b>Please</b> review the attachment. Date Time:'
|| TO_CHAR (SYSDATE, 'RR-MM-DD HH24:MI:SS'));
APEX_MAIL.ADD_ATTACHMENT (
p_mail_id => l_mailid,
p_attachment => l_report,
p_filename => TO_CHAR (SYSDATE, 'RRMMDDHH24MISS')
|| 'OracleApexDotCom.pdf',
p_mime_type => 'application/pdf');
COMMIT;
EXCEPTION
WHEN OTHERS
THEN
Proc_Ins_Error_Log (SQLCODE, SQLERRM));
END;
/
The mail successfully sent wif an attachment but the attachment can't open / show invalid pdf file.
But when me sent the attachment from my blob column it has no errors. And my query print report successfully wif rtf layout on button click.
My Question Is "How can I send an email from database with attachement from '.rtf' report format"?