3 Replies Latest reply on Sep 10, 2018 11:19 PM by Scott Wesley

    send email

    gharbeya

      i use apex 5.2

      how i send email from application ?

        • 1. Re: send email
          Bernhard FW
          1 person found this helpful
          • 2. Re: send email
            Bernhard FW

            in short:

            A) from within a form - add procedure of type "Send_email" and use substitutions/placeholders like  &P1_NAME. or  &P1_EMAIL. in the UI properties... - this is one email as per page/data

            Send_email.PNG

             

            B) loop thru records of a table and send emails to those records like: - this is: several emails in a row....

            FOR m IN (SELECT VORNAME, NACHNAME, EMAIL
                        FROM TABLE
            Where email is not null
                      and status = 'Aktiv'
            and ABTEILUNG like '%'||:P3_ABTEILUNG
                      )
            LOOP
              apex_mail.send( p_to => m.EMAIL,
                              p_from => 'info@my_email.de',
                              p_bcc => 'info2@my_2nd_email.com',
                              p_body => 'Hallo '||m.vorname||','||chr(10)||chr(10)||:P3_TEXT||chr(10)||
                            :P3_SIGNATURE               
                            ,
                              p_subj => :P3_SUBJECT
                            );
            end loop;
            

             

            :P3_TEXT, :P3_SIGNATURE, :P3_SUBJECT and :P3_ABTEILUNG are names of fields in page 3 - in SQL and pl/sql these types of substitutions are used... in the Procedure re A) "Send_email" UI we use substitutions of type: &P3_NAME.

             

            Hope that helps

            1 person found this helpful
            • 3. Re: send email
              Scott Wesley

              This is a poorly worded question to a topic that's widely talked about, and has a built-in API.

              https://docs.oracle.com/database/apex-5.1/AEAPI/APEX_MAIL.htm#AEAPI341

               

              ps - there is no APEX 5.2