3.5.4 Configuring Email

To enable APEX to send mail, an instance administrator must configure instance-level email settings.

Tip:

You can configure APEX to automatically email users their login credentials when a new workspace request has been approved. See About Specifying How Workspaces Are Created and Selecting a Workspace Provisioning Mode.

See Also:

Managing the Mail Queue and APEX_MAIL in Oracle APEX API Reference

3.5.4.1 About Enabling Network Services

Enabling network services enables support for sending outbound mail in Oracle APEX, use of Web services in APEX, and PDF report printing with BI Publisher.

By default, the ability to interact with network services is disabled in Oracle Database 11g Release 2 or later. Therefore, if you are running Oracle APEX with Oracle Database 11g Release 2 or later, you must use the new DBMS_NETWORK_ACL_ADMIN package to grant connect privileges to any host for the APEX_240100 database user. Failing to grant these privileges results in issues with:

  • Sending outbound mail in Oracle APEX.

    Users can call methods from the APEX_MAIL package, but issues arise when sending outbound email.

  • Consuming web services from APEX.

  • Making outbound LDAP calls from APEX.

  • PDF report printing with BI Publisher.

3.5.4.2 Configuring Email in a Full Development Environment

An Instance administrator must configure Oracle APEX to send mail in a full development environment.

To configure Oracle APEX to send mail in a full development environment:

  1. Sign in to Oracle APEX Administration Services.
  2. Click Manage Instance.
  3. Under Instance Settings, click Instance Settings.
  4. Under Email, edit the following:
    1. Oracle APEX Instance URL - Specify the URL to this APEX instance, including the trailing slash after the Database Access Descriptor or Context Root. This setting is used for system-generated emails. For example:

      https://www.example.com/apex/

    2. Oracle APEX Images URL - Specify the full URL to the images directory of this APEX instance, including the trailing slash after the images directory. This setting is used for system-generated emails..

      https://www.example.com/i/

    3. SMTP Host Address - Defines the server address of the SMTP server. By default on installation, this is set to localhost. If you are using another server as an SMTP relay, change this parameter to that server's address.
    4. SMTP Host Port - Defines the port the SMTP server listens to for mail requests. The default setting is 25.
    5. SMTP Authentication Username - If you enter a username, APEX authenticates against it when sending emails. Prior to Oracle Database 11g Release 2 (11.2.0.2), only the SMTP authentication scheme "LOGIN" is supported. On newer database versions, all authentication schemes of UTL_SMTP are supported.
    6. SMTP Authentication Password - If you enter a password, APEX authenticates against it when sending emails. Prior to Oracle Database 11g Release 2, Release 11.2.0.2, only the SMTP authentication scheme "LOGIN" is supported. On newer database versions, all authentication schemes of UTL_SMTP are supported.
    7. SMTP Password - Enter a password if your SMTP server requires authentication.
    8. Confirm SMTP Password - Enter the SMTP password again to confirm.
    9. Use SSL/TLS - Beginning with Oracle Database 11g Release 2, Release 11.2.0.2, APEX supports secure SMTP connections.

      Options include:

      • Yes - A secure connection with SSL/TLS is made before SMTP communication.

      • After connection is established - APEX sends the SMTP command STARTTLS immediately after the connection is opened.

      • No - A non-secure connection is opened.

    10. Default Email From Address - Defines the from address for tasks that generate email, such as approving a provision request or resetting a password.
    11. Maximum Emails per Workspace - Defines the number of email messages that can be sent with the APEX_MAIL API per workspace per 24 hour period.
    12. Maximum Emails Processed per Workspace - Defines the number of email messages that can be processed from the queue per workspace during each invocation of the mail job, ORACLE_APEX_MAIL_QUEUE.
  5. Click Apply Changes.

3.5.4.3 Configuring Email in a Runtime Environment

An Instance administrator must configure Oracle APEX to send mail in a runtime environment.

To configure APEX to send mail in a runtime environment:

  1. Start SQLcl and connect to the database where Oracle APEX is installed as SYS, for example:
    • On Windows:

      SYSTEM_DRIVE:\ sql /nolog
      SQL> CONNECT SYS as SYSDBA
      Enter password: SYS_password
      
    • On UNIX and Linux:

      $ sql /nolog
      SQL> CONNECT SYS as SYSDBA
      Enter password: SYS_password
      
  2. Run the following statement:
    BEGIN
       APEX_INSTANCE_ADMIN.SET_PARAMETER(PARAMETER_NAME, PARAMETER_VALUE);
       COMMIT;
    END;

    Tip:

    For a description of email parameters, see Configuring Email in a Full Development Environment.

  3. Once all parameters have been configured, validate the configuration:
    BEGIN
        APEX_INSTANCE_ADMIN.VALIDATE_EMAIL_CONFIG;
    END;

See Also:

SET_PARAMETER Procedure in Oracle APEX API Reference

3.5.4.4 Determining Email Settings in a Runtime Environment

Determine email settings in runtime environment.

To determine email settings in runtime environment:

  1. Start SQLcl and connect to the database where Oracle APEX is installed as SYS, for example:
    • On Windows:

      SYSTEM_DRIVE:\ sql /nolog
      SQL> CONNECT SYS as SYSDBA
      Enter password: SYS_password
      
    • On UNIX and Linux:

      $ sql /nolog
      SQL> CONNECT SYS as SYSDBA
      Enter password: SYS_password
      
  2. Run the following statement:
    SELECT 
    APEX_INSTANCE_ADMIN.GET_PARAMETER(PARAMETER_NAME)
    FROM DUAL;
    

    Tip:

    For a description of email parameters, see Configuring Email in a Full Development Environment.

See Also:

GET_PARAMETER Function in Oracle APEX API Reference