2 Replies Latest reply: Aug 13, 2014 6:50 PM by Raúl Soto RSS

    Need help in sending mail in xml publisher reports

    user13424229

      Dear All,

      I have a procedure in that i am attaching two layout to two program and submitting the prog.

      so once both layout attached successfully i need to send both the output in mail to one mail id, so please help me out how i can send multiple attchment in mail.

      is it possible in PL/SQL or need to use bursting in xml publisher reports.

       

      Thnaks

        • 1. Re: Need help in sending mail in xml publisher reports
          user13424229

          Dear All,

          I tried below;

          v_Mail_Conn := utl_smtp.Open_Connection(v_Mail_Host, 25);

           

            utl_smtp.Helo(v_Mail_Conn, v_Mail_Host);

            utl_smtp.Mail(v_Mail_Conn, v_From);

            utl_smtp.Rcpt(v_Mail_Conn, v_Recipient);

            v_utl_filehandler := UTL_FILE.FOPEN('/usr/tmp','test.txt', 'R');   ---how i can pass this file as attachment

            utl_smtp.Data(v_Mail_Conn,

              'Date: '   || to_char(sysdate, 'Dy, DD Mon YYYY hh24:mi:ss') || crlf ||

              'From: '   || v_From || crlf ||

              'Subject: '|| v_Subject || crlf ||

              'To: '     || v_Recipient || crlf ||

              'MIME-Version: 1.0'|| crlf || -- Use MIME mail standard

              'Content-Type: multipart/mixed;'|| crlf ||

              ' boundary="-----SECBOUND"'|| crlf ||

              crlf ||

              '-------SECBOUND'|| crlf ||

              'Content-Type: text/plain;'|| crlf ||

              'Content-Transfer_Encoding: 7bit'|| crlf ||

              crlf ||

              'some message text'|| crlf || -- Message body

              'more message text'|| crlf ||

              crlf ||

              '-------SECBOUND'|| crlf ||

              'Content-Type: text/plain;'|| crlf ||

              ' name=v_utl_filehandler'|| crlf ||------------------------I tried by passing the v_utl_filehandler  it is giving soem junk data

              'Content-Transfer_Encoding: 8bit'|| crlf ||

              'Content-Disposition: attachment;'|| crlf ||

              ' filename=v_utl_filehandler'|| crlf ||

              crlf ||

             --- 'CSV,file,attachement'|| crlf || -- Content of attachment

              crlf ||

           

          '-------SECBOUND'|| crlf ||

              'Content-Type: text/plain;'|| crlf ||

              ' name=v_utl_filehandler'|| crlf ||

              'Content-Transfer_Encoding: 8bit'|| crlf ||

              'Content-Disposition: attachment;'|| crlf ||

              ' filename=v_utl_filehandler'|| crlf ||

              crlf ||

             --- 'CSV,file,attachement'|| crlf || -- Content of attachment

              crlf ||

              '-------SECBOUND--' -- End MIME mail

            );

            utl_smtp.Quit(v_mail_conn);

           

          Please help me how i can pass file from server as attachment.

           

          Thnaks

          • 2. Re: Need help in sending mail in xml publisher reports
            Raúl Soto

            Hi,

             

            Your problem maybe is solved in Oracle PL/SQL forum. I think you can to send a blob attachments in a email using PL/SQL.

             

            In BI Publisher you can send any report (in xml, pdf, xls, html... format) by email, ftp, printer, web folder or fax creating a Report Job and also you can receive a notification if you needed [2]

             

            [1] http://www.techrepublic.com/blog/software-engineer/sending-blob-attachments-in-e-mail-with-utl-smtp/

            [2] Creating Report Jobs - 11g Release 1 (11.1.1)

             

            Regards.