3.5.4 Configuring Email

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

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

Note:

To learn more about configuring email in Oracle APEX with Autonomous AI Database, see Send Email from APEX in Using Oracle Autonomous AI Database Serverless.

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_260100 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

In a full development environment, an Instance administrator must configure Oracle APEX to send mail.

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. Edit the following Email attributes:
    1. Email, 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. Email, 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. Email, 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. Email, SMTP Host Port - Defines the port the SMTP server listens to for mail requests. The default setting is 25.
    5. Email, SMTP Authentication Username - Enter a username if your SMTP server requires authentication. This username can be overridden at the workspace-level using a Web Credential.
    6. Email, SMTP Password - Enter a password if your SMTP server requires authentication. This password can be overridden at the workspace-level using a Web Credential.
    7. Email, Confirm SMTP Password - Enter the SMTP password again to confirm.
    8. Email, Use SSL/TLS - Oracle 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.

    9. Email, Default Email From Address - Defines the from address for tasks that generate email, such as approving a provision request or resetting a password.
    10. Email, 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.
    11. Email, 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

In a runtime environment, an Instance administrator must configure Oracle APEX to send mail .

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;

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