3 Replies Latest reply: Apr 30, 2014 12:59 AM by 2663985 RSS

    4.2.5 Patchset Update causing apex_mail formatting problem

    chizwiz_33

      I am running Oracle DB 11.2.0.3 on Windowsx64 and Apex 4.2.4.  I recently applied the patchset 4.2 --> 4.2.5 update and I am seeing some weird behavior in the emails that Apex sends.  When viewing the email in an HTML format (i.e. with Outlook), I see paragraph breaks and content-type information in the p_body section such as:

       

      Down Category:

      Comment: <p>

                      this is a comment</p>

       

      ----=:A4D7E7711C6A4607A5351F61BF5DF987:

      Content-Type: text/html; charset=utf-8

       

      Down Category: <strong>Comment:</strong> <p>

                      this is a comment</p>

      ----=:A4D7E7711C6A4607A5351F61BF5DF987:--

       

       

      The PL/SQL code to generate the email looks like the following, and has been working perfectly in all previous versions of Apex where I specify p_body and p_body_html and if the reader is HTML capable, it only displays the HTML portion:

       

      email_id := apex_mail.send(p_to => address_list,

                                 p_from => from_address,

                                 p_body => v_log,

                                 p_body_html => v_log_html,

                                 p_subj => subject);

       

      Any ideas as to what would cause this?

       

      Thanks,

      -Ian

        • 1. Re: 4.2.5 Patchset Update causing apex_mail formatting problem
          GhanaApexDeveloper

          HI ,

          can u produce  the content of the HTML body here, my guess is to do with the HTML doctype.

          THanks

          BEnjamin

          • 2. Re: 4.2.5 Patchset Update causing apex_mail formatting problem
            chizwiz_33

            Hi,

            I am not exactly sure if this is what you're asking for, but here is how I build the p_body and p_body_html variables in my PL/SQL block:

             

            v_log_html := 'Timestamp: <strong>' ||  time;

            v_log_html := v_log_html || '</strong><br/>Down Category: <strong>'  || down_reas;

            v_log_html := v_log_html || '</strong><br/><br/><strong>Comment:</strong> ' || change_comment;

             

             

                   

            v_log := ' Timestamp: ' ||  time || chr(10);

            v_log := v_log || ' Down Category: ' ||  down_reas || chr(10);

            v_log := v_log || ' Comment: ' ||  change_comment || chr(10);

             

             

            And here is what my apex_mail block looks like:

             

            apex_mail.send(p_to => address_list,

                                       p_from => from_address,

                                       p_body => v_log,

                                       p_body_html => v_log_html,

                                       p_subj => equip || ', ' || new_status || ' event');

             

            -Ian

            • 3. Re: 4.2.5 Patchset Update causing apex_mail formatting problem
              2663985

              It is patchset 4.2.5 that causes this problem.

               

              Oracle has a patch to resolve this.

               

              Oracle Application Express 4.2.5 Known Issues

               

              • 18658967 - CORRUPTED HTML MAIL MESSAGES ARE CREATED FROM APEX_MAIL.SEND
                After upgrading to Application Express 4.2.5 or applying the Application Express 4.2.5 patch set, on some mail servers, any messages sent with the APEX_MAIL.SEND API and which contain an HTML email body will appear to the recipient as corrupted. The recipient will often see that the body of the mail contains message boundaries and headers, like:
                  ----=:0CF735AA12E385B1DA023B0BB6124789:
                  Content-Type: text/html; charset=utf-8

                Solution: There is a patchset exception for this available on My Oracle Support - search by bug number.