Home » SQL & PL/SQL » SQL & PL/SQL » In SEND EMAIL code, how to remove Boundaries from the output (Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 )
In SEND EMAIL code, how to remove Boundaries from the output [message #677787] Fri, 11 October 2019 12:36 Go to previous message
rappaj
Messages: 147
Registered: June 2010
Location: NYC
Senior Member
Hi,

Hopefully the Subject wording is correct here.


Here is my issue. I created a procedure that sends out an email with some custom wording I provided. It works, however I get some garbage data before the p_text and the p_html, and after the p_html.
I would like to remove them if possible so the email can be clean.

I noticed that in our in-house email package, there are 2 procedures that have the garbage wording that I am trying to get rid of. I will paste pictures below...

Here is my sample procedure I shortened up for your help...


create or replace PROCEDURE PAY_SEND_TREASURY_EMAIL_PROC as 
 begin
  for cur_r in (select empl_email, 
                       n_txt_1 DISPLAY_SUBJECT, 
                       n_txt_2 DISPLAY_MSG
        FROM      TEST_SEND_EMAIL_To_joe 
               ) loop
           
    anc_pkg.p_html_email(
                         p_to       => cur_r.empl_email 
                        ,p_from     => 'do_not_reply@nycha.nyc.gov'
                        ,p_subject  => cur_r.DISPLAY_SUBJECT
                        ,p_text     => 'IT TESTING !!!  Please complete forms ASAP, Thank you.'
                        ,p_html     =>  cur_r.DISPLAY_MSG
                  );
  end loop;
end;
/




EXECUTE PAY_SEND_TREASURY_EMAIL_PROC

This is my email message below that was generated with the garbage data(.jpg also uploaded):

Reply-To: do_not_reply@nycha.nyc.gov
Content-Type: multipart/alternative; boundary="a1b2c3d4e3f2g1"
--a1b2c3d4e3f2g1
content-type: text/plain; charset=us-ascii

IT TESTING !!!  Please complete forms ASAP, Thank you.

--a1b2c3d4e3f2g1
content-type: text/html;


Year--> 2019    PP--> 09    Location--> 0834    ( NextGen Ops 1 Manhattan Planning Unit )

Year--> 2019    PP--> 21    Location--> 0834    ( NextGen Ops 1 Manhattan Planning Unit )

--a1b2c3d4e3f2g1--



How do I remove these 3 boundary sections from my email message above? The user does not need to see that.

Content-Type: multipart/alternative; boundary="a1b2c3d4e3f2g1"
--a1b2c3d4e3f2g1
content-type: text/plain; charset=us-ascii

--a1b2c3d4e3f2g1
content-type: text/html;


--a1b2c3d4e3f2g1--



This is the boundary code in the in-house email package



l_boundary      varchar2(255) default 'a1b2c3d4e3f2g1';

l_temp := l_temp || 'Content-Type: multipart/alternative; boundary=' ||
                         chr(34) || l_boundary ||  chr(34) || chr(13) ||
                         chr(10);

----------------------------------------------------
    -- Write the text boundary
    l_offset := dbms_lob.getlength(l_body_html) + 1;
    l_temp   := '--' || l_boundary || chr(13)||chr(10);
    l_temp   := l_temp || 'content-type: text/plain; charset=us-ascii' ||
                  chr(13) || chr(10) || chr(13) || chr(10);
    dbms_lob.write(l_body_html,length(l_temp),l_offset,l_temp);

    ----------------------------------------------------

    -- Write the HTML boundary
    l_temp   := chr(13)||chr(10)||chr(13)||chr(10)||'--' || l_boundary ||
                    chr(13) || chr(10);
    l_temp   := l_temp || 'content-type: text/html;' ||
                   chr(13) || chr(10) || chr(13) || chr(10);
    l_offset := dbms_lob.getlength(l_body_html) + 1;
    dbms_lob.write(l_body_html,length(l_temp),l_offset,l_temp);



Can someone please guide me on what to do next?



Thanks
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Run Oracle SQL query multiple times with change in filter condition
Next Topic: delete from table where one of the column is nested table is running long.
Goto Forum:
  


Current Time: Fri Apr 03 02:38:00 CDT 2020