1 2 3 Previous Next 33 Replies Latest reply: Jun 11, 2012 12:44 PM by 935316 RSS

    How to send  Mail from APEX 4.1?

    Gurujothi
      Dear all,
      In APEX 4.1,
      I have a form based on the Leave_table,
      it has 5 fields,
      If the user filled all the fields and if the user clicks the APPLY/SUBMIT button the Data will be stored into the LEAVE_table ,

      Is this Possible to send the mail with the data entered as a report to a particular (manager)mail_id?
      and also the mail to contain two link/button to REJECT or APPROVE the leave applied ?
      Is this possible in apex and how it can be done?
      Thank you.
      Regards,
      Gurujothi.
        • 1. Re: How to send  Mail from APEX 4.1?
          VC
          Hi Gurujothi,

          Please create a send-email page process after the your from DML and add what ever HTML code you want to the email body.

          You can add buttons too in the email body using HTML and when the user receives that email he then have to click on the button to login into your application to approve or reject.

          Thanks
          • 2. Re: How to send  Mail from APEX 4.1?
            Gurujothi
            Hi VC ,
            Thank you for your response,
            I will do as you said if any doubt i will post here.
            thank you.
            • 3. Re: How to send  Mail from APEX 4.1?
              Svetoslav Gyurov
              Hi Gurujothi,

              To be able to send emails from APEX you need first to set an email server within the APEX. To do so you need to login to APEX admin console, then go to Manage Instance and then Instance settings, there you should set SMTP server and port, for more information look here:
              http://docs.oracle.com/cd/E17556_01/doc/admin.40/e15521/adm_mg_service_set.htm#BEJBCEEH

              One more thing if you running Oracle 11g you should configure Fine-Grained access to External Network Services to allow APEX to access the SMTP server. Tim Hall has a very good explanation on that and you can find it here:
              http://www.oracle-base.com/articles/11g/fine-grained-access-to-network-services-11gr1.php

              Regards,
              Sve
              • 4. Re: How to send  Mail from APEX 4.1?
                Gurujothi
                Hi VC and sve,
                can you please tel me,

                if the users applying the leave by filling the form,
                it has the following fields,
                DESCRIBE leave_transaction
                
                Column
                                         
                LEAVE_ID                          
                 EMP_ID                    
                 EMP_NAME                
                 GENDER                     
                 LEAVE_TYPE_NAME               
                 LEAVE_TYPE_CODE                
                 DESIGNATION          
                 FROM_DATE                    
                 TO_DATE                    
                 NO_OF_DAYS               
                 REASON                         
                 REMAINING_DAYS     
                Status
                when they apply ,it will be shown as report in my superior page(i.e 5th page) He has to REJECT or APPROVE the leave applied and the "Status" column should be updated as REJECT or APPROVE based on superior action,
                How it is possible in APEX 4.1?
                Can you please Help me.
                Thank you.
                • 5. Re: How to send  Mail from APEX 4.1?
                  Gurujothi
                  hello VC and sve,
                  DECLARE
                  ACL_PATH VARCHAR2(4000);
                  ACL_ID RAW(16);
                  BEGIN
                  
                  SELECT ACL INTO ACL_PATH FROM DBA_NETWORK_ACLS
                  WHERE HOST = 'hostname' AND LOWER_PORT IS NULL AND UPPER_PORT IS NULL;
                  
                  SELECT SYS_OP_R2O(extractValue(P.RES, '/Resource/XMLRef')) INTO ACL_ID
                  FROM XDB.XDB$ACL A, PATH_VIEW P
                  WHERE extractValue(P.RES, '/Resource/XMLRef') = REF(A) AND
                  EQUALS_PATH(P.RES, ACL_PATH) = 1;
                  
                  DBMS_XDBZ.ValidateACL(ACL_ID);
                  IF DBMS_NETWORK_ACL_ADMIN.CHECK_PRIVILEGE(ACL_PATH, 'APEX_040100',
                  'connect') IS NULL THEN
                  DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(ACL_PATH,
                  'APEX_040100', TRUE, 'connect');
                  END IF;
                  EXCEPTION
                  
                  WHEN NO_DATA_FOUND THEN
                  DBMS_NETWORK_ACL_ADMIN.CREATE_ACL('local-access-users1.xml',
                  'ACL that lets power users to connect to everywhere',
                  'APEX_040100', TRUE, 'connect');
                  DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL('local-access-users1.xml','hostname');
                  END;
                  /
                  here what are the things I have to modify and what it means,
                  'APEX_040100', whether I have to change('APEX_040100',) it to my workspace name or workspace username?
                  and for my application how to modify the above code.
                  • 6. Re: How to send  Mail from APEX 4.1?
                    VC
                    Gurujothi wrote:
                    hello VC and sve,
                    DECLARE
                    ACL_PATH VARCHAR2(4000);
                    ACL_ID RAW(16);
                    BEGIN
                    
                    SELECT ACL INTO ACL_PATH FROM DBA_NETWORK_ACLS
                    WHERE HOST = 'hostname' AND LOWER_PORT IS NULL AND UPPER_PORT IS NULL;
                    
                    SELECT SYS_OP_R2O(extractValue(P.RES, '/Resource/XMLRef')) INTO ACL_ID
                    FROM XDB.XDB$ACL A, PATH_VIEW P
                    WHERE extractValue(P.RES, '/Resource/XMLRef') = REF(A) AND
                    EQUALS_PATH(P.RES, ACL_PATH) = 1;
                    
                    DBMS_XDBZ.ValidateACL(ACL_ID);
                    IF DBMS_NETWORK_ACL_ADMIN.CHECK_PRIVILEGE(ACL_PATH, 'APEX_040100',
                    'connect') IS NULL THEN
                    DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(ACL_PATH,
                    'APEX_040100', TRUE, 'connect');
                    END IF;
                    EXCEPTION
                    
                    WHEN NO_DATA_FOUND THEN
                    DBMS_NETWORK_ACL_ADMIN.CREATE_ACL('local-access-users1.xml',
                    'ACL that lets power users to connect to everywhere',
                    'APEX_040100', TRUE, 'connect');
                    DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL('local-access-users1.xml','hostname');
                    END;
                    /
                    here what are the things I have to modify and what it means,
                    'APEX_040100', whether I have to change('APEX_040100',) it to my workspace name or workspace username?
                    and for my application how to modify the above code.
                    Not sure what you are trying to do here because I have never used this package, but you can look at the oracle doc here http://docs.oracle.com/cd/B28359_01/appdev.111/b28419/d_networkacl_adm.htm
                    • 7. Re: How to send  Mail from APEX 4.1?
                      VC
                      Gurujothi wrote:
                      Hi VC and sve,
                      can you please tel me,

                      if the users applying the leave by filling the form,
                      it has the following fields,
                      DESCRIBE leave_transaction
                      
                      Column
                                               
                      LEAVE_ID                          
                      EMP_ID                    
                      EMP_NAME                
                      GENDER                     
                      LEAVE_TYPE_NAME               
                      LEAVE_TYPE_CODE                
                      DESIGNATION          
                      FROM_DATE                    
                      TO_DATE                    
                      NO_OF_DAYS               
                      REASON                         
                      REMAINING_DAYS     
                      Status
                      when they apply ,it will be shown as report in my superior page(i.e 5th page) He has to REJECT or APPROVE the leave applied and the "Status" column should be updated as REJECT or APPROVE based on superior action,
                      How it is possible in APEX 4.1?
                      Can you please Help me.
                      Thank you.
                      Are you able to send the email first of all?

                      In your email body add two buttons Approve and Reject and both buttons should point to your application form that manages leave transaction.
                      and once the user clicks one of those buttons it will open the url of you app prompting them to login.

                      If their login is success full then the page is redirected dml form page with that particular record, where they can now click on approve or reject

                      You need to do all this by your own.

                      Thanks
                      • 8. Re: How to send  Mail from APEX 4.1?
                        Gurujothi
                        Hi VC,
                        Sorry still I coundn't send the mail,Can you please give me the step by step procedure how to configure it and what are the steps to follow,
                        am using APEX 4.1 and Oracle Database 11g.
                        Kindly help me to configure this.
                        Thank you.
                        • 9. Re: How to send  Mail from APEX 4.1?
                          VC
                          Do you have a SMTP server?

                          Look at this Setup SMTP with Apex 4.0
                          • 10. Re: How to send  Mail from APEX 4.1?
                            Gurujothi
                            Hi VC,
                            Whether the settings is same for apex 4.0 and apex 4.1?
                            • 11. Re: How to send  Mail from APEX 4.1?
                              Gurujothi
                              Hi VC,
                              I finished the following steps,
                              Configuring Email in a Full Development Environment
                              Then next?
                              • 12. Re: How to send  Mail from APEX 4.1?
                                Gurujothi
                                Hi VC,
                                after I did that settings,
                                if I click the Home button in the bottom of the application am getting the following error,
                                Help
                                     Error     Accounts in the INTERNAL workspace can be used only for Application Express service administration.
                                Contact your application administrator.
                                OK
                                • 13. Re: How to send  Mail from APEX 4.1?
                                  VC
                                  then login to your application and test the email bit using http://docs.oracle.com/cd/E23903_01/doc/doc.41/e21676/apex_mail.htm#AEAPI342
                                  • 14. Re: How to send  Mail from APEX 4.1?
                                    Gurujothi
                                    Hi VC,
                                    I cant understand where to run that codes?
                                    1 2 3 Previous Next