Search code examples
oracle-databaseplsqlplsqldeveloper

Can we send an email with excel containing multiple worksheets in oracle?


I wish to send an email which will contain one excel file with multiple sheets in oracle SQL developer.


Solution

  • You can refer to below link for above question: Steps which i performed are listed below:

    Step 1: compile above procedure [This link will allow to send an email attaching file from FTP which will be created in step 2]

    https://renaps.com/en/blog/how-to/simple-example-of-sending-attachments-using-utlsmtp

    Step 2: This procedure will let you create an excel with multiple sheets and which will be generated in FTP i.e directory

    https://community.oracle.com/thread/2544010?start=0&tstart=0

    Step 3: Execute below command to receive mail.

    set serveroutput on

    exec mail_files('<from_email_id>', '<to_email_id>', '<subject_line>', 'message_body', '<directory_name>', '<file_name_to_be_attached>');