Search This Blog

Tuesday, July 8, 2025

How Do I Configure SMTP Parameters in Autonomous Database.

Introduction
Configuring SMTP parameters in an Autonomous Database is essential for enabling your Oracle APEX applications to send emails such as notifications, alerts, and confirmations. Proper SMTP setup ensures that emails are sent securely and reliably through a trusted mail server. This configuration involves specifying the SMTP host, port, authentication credentials, and security protocols to connect your Autonomous Database environment with an SMTP service.

 To configure SMTP parameters in an Autonomous Database (ADB) for Oracle APEX email delivery, you must set the mail server settings that APEX uses to send outgoing emails. This setup ensures that your APEX applications can send notifications, confirmations, and alerts via email using a trusted SMTP service such as Oracle Cloud Infrastructure (OCI) Email Delivery or any external SMTP provider.

Here is a detailed step-by-step guide to configure SMTP parameters in Autonomous Database:

  1. Access Oracle APEX Instance Administration
    Log in to the APEX workspace with an administrative account (usually the workspace with admin privileges or the instance admin workspace). From the APEX home page, navigate to Manage Instance or Instance Administration.

  2. Open Instance Settings for Email Configuration
    In the administration interface, select Instance Settings. Scroll to the Email section where SMTP configuration parameters are set.

  3. Set SMTP Host and Port
    Enter the hostname or IP address of your SMTP server in the SMTP Host Address field. For OCI Email Delivery, this might be a region-specific endpoint such as:
    smtp.email.us-ashburn-1.oci.oraclecloud.com

    Specify the SMTP port:

    • Use 587 for TLS/STARTTLS

    • Use 465 for SSL connections

  4. Enter SMTP Authentication Credentials
    Provide the SMTP username and password in the respective fields. For OCI Email Delivery, this will be the SMTP credentials generated in the Oracle Cloud Console under Identity > Users > SMTP Credentials.

  5. Enable Secure Connection
    Select whether to use SSL or TLS/STARTTLS based on your SMTP server requirements. For most modern SMTP services including OCI Email Delivery, enabling STARTTLS on port 587 is recommended to encrypt the connection.

  6. Configure Default Sender Email
    Enter a valid and approved sender email address. This is the email address that will appear in the From field of outgoing emails. For OCI Email Delivery, this address must be registered as an approved sender in the OCI Email Delivery service.

  7. Save and Apply Settings
    After entering all the required SMTP parameters, save the configuration. The changes apply immediately to outgoing emails sent from APEX applications in this Autonomous Database environment.

  8. Test Email Configuration
    You can verify the configuration by sending a test email from the Instance Administration page or by executing a PL/SQL block using the APEX_MAIL package, such as:

    BEGIN
      APEX_MAIL.SEND(
        p_to        => 'your.email@example.com',
        p_from      => 'noreply@yourdomain.com',
        p_subj      => 'SMTP Configuration Test',
        p_body      => 'This is a test email sent after configuring SMTP parameters in Autonomous Database.'
      );
      APEX_MAIL.PUSH_QUEUE;
    END;
    
  9. Monitor Mail Logs and Queue
    Check the status of sent emails by querying the APEX_MAIL_LOG and APEX_MAIL_QUEUE views to troubleshoot delivery or queue issues.

  10. Best Practices

    • Use secure SMTP authentication to protect credentials.

    • Keep your SMTP credentials confidential and never expose them in public code repositories.

    • Ensure your domain’s SPF and DKIM DNS records authorize the SMTP server to send emails on behalf of your domain to prevent delivery issues.

    • Regularly monitor email logs to identify any sending failures.

By carefully configuring the SMTP parameters in your Autonomous Database instance, you enable your Oracle APEX applications to reliably send emails, improving communication and workflow automation for end users.

  • Connect to the Autonomous Database as an ADMIN user.

  • Use the APEX_INSTANCE_ADMIN.SET_PARAMETER procedure to set SMTP parameters.

  • Example PL/SQL script:

BEGIN

    APEX_INSTANCE_ADMIN.SET_PARAMETER('SMTP_HOST_ADDRESS', 'smtp.us-phoenix-1.oraclecloud.com');

    APEX_INSTANCE_ADMIN.SET_PARAMETER('SMTP_USERNAME', 'ocid1.user.oc1.username');

    APEX_INSTANCE_ADMIN.SET_PARAMETER('SMTP_PASSWORD', 'password');

    COMMIT;

END;

/

  • The default values for SMTP_HOST_PORT (587) and SMTP_TLS_MODE (STARTTLS) should be retained.

Setting Up SMTP in Oracle APEX

The SMTP settings can be configured at the Instance Level in Oracle APEX. Follow these steps to configure SMTP settings:

  1. Log in to APEX Instance Administration.

  2. Navigate to Email Configuration under the Instance Settings.

  3. Enter the SMTP Host, Port, and any required authentication details.

Save the configuration and test email functionality using APEX_MAIL.SEND.

Using APEX_MAIL to Send Emails

Oracle APEX provides the APEX_MAIL package to send emails programmatically from within an application.

Example of sending an email using PL/SQL:

BEGIN

    APEX_MAIL.SEND (

        p_to        => 'recipient@example.com',

        p_from      => 'sender@example.com',

        p_subj      => 'Test Email from APEX',

        p_body      => 'This is a test email sent from Oracle APEX.'

    );

    COMMIT; -- Required to process the email queue

END;

  • p_to: Recipient’s email address.

  • p_from: Sender’s email address (must be configured in SMTP settings).

  • p_subj: Email subject line.

  • p_body: Email message content.

How To Programatically Send HTML Emails

To format emails with HTML content, use the p_body_html parameter:

BEGIN

    APEX_MAIL.SEND (

        p_to        => 'recipient@example.com',

        p_from      => 'sender@example.com',

        p_subj      => 'HTML Email from APEX',

        p_body_html => '<h1>Hello from APEX</h1><p>This is a test email.</p>'

    );

    COMMIT;

END;


How To Programatically Send Emails with Attachments

DECLARE

    v_attachment BLOB;

BEGIN

    -- Retrieve the file from APEX collection, table, or another source

    SELECT file_blob INTO v_attachment FROM my_table WHERE file_id = 1;

    

    APEX_MAIL.ADD_ATTACHMENT (

        p_mail_id     => APEX_MAIL.SEND (

            p_to    => 'recipient@example.com',

            p_from  => 'approved-sender@example.com',

            p_subj  => 'Email with Attachment',

            p_body  => 'Please find the attached file.'

        ),

        p_attachment  => v_attachment,

        p_filename    => 'document.pdf',

        p_mime_type   => 'application/pdf'

    );

    COMMIT;

END;


Manually/ Programatically Processing the Email Queue

If emails are stuck in the queue, manually push them for processing:

BEGIN

    APEX_MAIL.PUSH_QUEUE;

END;

 

 Debugging Email Issues

If emails are not being sent, check the following:

  • Verify SMTP settings in Instance Administration.

  • Ensure the APEX_MAIL_QUEUE has no errors.

  • Check the database logs for any SMTP connection errors.

Make sure the APEX Mail Queue Process is scheduled and running.

 

Conclusion
By correctly configuring SMTP parameters in your Autonomous Database, you empower your Oracle APEX applications to communicate effectively with users via email. This setup not only supports essential messaging features but also helps maintain security and deliverability, ensuring that your application’s emails reach their intended recipients consistently and securely.

 

How Do I Configure Email in Autonomous Database with OCI Email Delivery

 

Introduction
Configuring email in Oracle APEX running on an Autonomous Database with OCI Email Delivery allows your applications to send reliable and secure emails using Oracle Cloud Infrastructure’s managed SMTP service. This setup supports sending notifications, confirmations, and system alerts while meeting modern authentication and security standards. It requires setting up an approved sender, generating SMTP credentials, and connecting your APEX environment to OCI Email Delivery through proper SMTP configuration.

 
  1. Identify the SMTP Endpoint

    • The SMTP host address must be obtained from OCI Email Delivery settings.

  2. Generate SMTP Credentials

    • SMTP credentials are needed to authenticate email requests.

  3. Create an Approved Sender

    • Only approved sender email addresses can be used in APEX.

  4. Set SMTP Parameters in APEX

  • Use the APEX_INSTANCE_ADMIN.SET_PARAMETER procedure to configure SMTP settings. 
 To configure email in Oracle APEX running on Autonomous Database (ADB) with Oracle Cloud Infrastructure (OCI) Email Delivery, you must integrate APEX with OCI’s secure SMTP relay. This allows your APEX application to send transactional and notification emails using Oracle’s managed email infrastructure, which supports SPF, DKIM, and secure SMTP authentication. The setup includes configuring OCI Email Delivery, creating SMTP credentials, and updating the APEX environment.

Here’s a detailed step-by-step guide:

  1. Prerequisites

    • You must have an Oracle Cloud account with appropriate permissions.

    • Your APEX environment must run on Autonomous Database (Shared or Dedicated).

    • An approved OCI Email Delivery sender must be registered.

  2. Create an Approved Sender in OCI Email Delivery

    • Sign in to the OCI Console.

    • Go to Email Delivery > Approved Senders.

    • Click Create Approved Sender and enter an email address (e.g., noreply@yourdomain.com).

    • The sender must be verified if your domain has domain protection enabled (DKIM/SPF records).

    • Wait for the sender to be approved.

  3. Generate SMTP Credentials

    • In the OCI Console, go to Identity > Users.

    • Select the user who will send emails (or create a service user for email).

    • Click SMTP Credentials > Generate SMTP Credentials.

    • Save the generated username and password — these will be used in APEX to authenticate.

  4. Locate the OCI SMTP Server Details
    Use these values in your APEX email configuration:

    • SMTP Host: smtp.email.us-ashburn-1.oci.oraclecloud.com (or region-specific endpoint)

    • SMTP Port: 587 (STARTTLS) or 465 (SSL)

    • Username: The generated OCI SMTP username

    • Password: The generated OCI SMTP password

  5. Configure Email in APEX on Autonomous Database

    • Log in to your APEX workspace using the ADMIN account.

    • Go to Manage Instance > Instance Settings > Email.

    • Enter:

      • SMTP Host Address: Use the OCI SMTP hostname.

      • SMTP Port: 587

      • Username and Password: Use the generated SMTP credentials

      • Use SSL/TLS: Enabled (typically STARTTLS with port 587)

      • Sender Address: Must match your approved sender (e.g., noreply@yourdomain.com)

    • Click Apply Changes.

  6. Test the Email Configuration in APEX
    You can send a test email using PL/SQL in SQL Workshop or as a page process:

    BEGIN
      APEX_MAIL.SEND(
        p_to        => 'yourtestemail@example.com',
        p_from      => 'noreply@yourdomain.com',
        p_subj      => 'Test Email from APEX with OCI Email Delivery',
        p_body      => 'This is a plain text test email.',
        p_body_html => '<p>This is a <strong>test email</strong> using OCI Email Delivery.</p>'
      );
      APEX_MAIL.PUSH_QUEUE;
    END;
    
  7. Verify Delivery

    • Monitor delivery by checking your test inbox.

    • Use the APEX_MAIL_LOG view to inspect email status:

    SELECT * FROM APEX_MAIL_LOG ORDER BY SENT_DATE DESC;
    
    • For pending messages, check:

    SELECT * FROM APEX_MAIL_QUEUE;
    
  8. Best Practices

    • Use the same From address as your approved sender.

    • Avoid sending test emails to external users in development.

    • Configure your domain’s SPF and DKIM records to allow OCI as a sender for your domain.

    • Monitor usage from the OCI Console to stay within quota and compliance limits.

By completing this configuration, your APEX apps running on Autonomous Database will be able to send emails securely through OCI’s robust delivery infrastructure, supporting reliable communication, compliance, and high deliverability.

Conclusion
By integrating OCI Email Delivery with Oracle APEX on Autonomous Database, you enable trusted and secure email communication directly from your application. With the approved sender and SMTP credentials in place, APEX can send dynamic, user-friendly emails that enhance user experience and operational efficiency—while staying compliant with cloud security practices.

How Do I Configure Email in a Full Development Environment

 

Introduction
Configuring email in a full development environment for Oracle APEX is essential for testing and validating the application's ability to send notifications, confirmations, and alerts. Unlike production environments, development environments require flexible, secure, and test-friendly SMTP setups. This includes configuring SMTP parameters, enabling the APEX_MAIL package, and using tools like mail traps or staging email servers to avoid sending real emails during development.

 
  1. Sign in to Oracle APEX Administration Services.

  2. Go to "Manage Instance" and select "Instance Settings".

  3. Navigate to the Email section under "Storage".

  4. Enter the required SMTP settings and save the changes.

To configure email in a full development environment for Oracle APEX, you need to set up an email delivery path that mimics production but is safe for testing. This means connecting Oracle APEX to a valid SMTP server or using a mail trap service to catch outgoing emails without actually sending them to real users. This setup helps developers test APEX features like password resets, contact forms, and workflow alerts in a controlled, secure way.

Here’s a detailed breakdown of how to configure email in a full development environment:

  1. Choose a Mail Server or Mail Trap
    In a development environment, you can use one of the following:

    • A test SMTP service like MailHog, Papercut, or smtp4dev running locally.

    • A cloud-based trap like Mailtrap.io, Mailosaur, or SendGrid in sandbox mode.

    • Your organization’s test SMTP server, isolated from production.

  2. Configure SMTP Settings for APEX
    Oracle APEX relies on SMTP settings configured in the environment. How you configure these depends on your APEX setup:

    • APEX on ORDS (On-Premise):
      In your ORDS config directory (typically under config/ords/standalone/ or similar), locate or create the file ords.defaults.properties and add:

      mail.smtp.host=smtp.mailtrap.io
      mail.smtp.port=2525
      mail.smtp.username=your_username
      mail.smtp.password=your_password
      mail.smtp.auth=true
      mail.smtp.starttls.enable=true
      

      Restart ORDS after making changes.

    • APEX on Oracle Cloud or Autonomous Database:
      Go to Manage Instance > Instance Settings > Email from the APEX Administration Services and enter the SMTP host, port, username, and password.

  3. Grant Access to APEX_MAIL Package
    Ensure your application schema can use the APEX mail features:

    GRANT EXECUTE ON APEX_MAIL TO your_schema;
    
  4. Send a Test Email Using PL/SQL
    In your application (e.g., in a page process or button click event), test email delivery:

    BEGIN
      APEX_MAIL.SEND(
        p_to        => 'developer@fakeemail.com',
        p_from      => 'noreply@yourdevapp.com',
        p_subj      => 'Development Test Email',
        p_body      => 'This is a plain text email for testing.',
        p_body_html => '<p>This is an <strong>HTML</strong> test email from development.</p>'
      );
    
      APEX_MAIL.PUSH_QUEUE;
    END;
    

    After running this, check your test mailbox or mail trap to confirm delivery.

  5. Push the Mail Queue in Development
    If the environment does not automatically process the mail queue, use:

    BEGIN
      APEX_MAIL.PUSH_QUEUE;
    END;
    

    This manually triggers the queue to send pending emails.

  6. Use Test-Friendly Email Addresses
    Never use real customer email addresses in development. Use dummy addresses or those controlled by your development team to avoid accidental delivery.

  7. Monitor and Debug

    • Use the APEX_MAIL_LOG to view email status:

      SELECT * FROM APEX_MAIL_LOG ORDER BY SENT_DATE DESC;
      
    • Use the APEX_MAIL_QUEUE to view emails waiting to be sent:

      SELECT * FROM APEX_MAIL_QUEUE;
      
  8. Secure Your Configuration

    • Keep credentials out of version-controlled files.

    • Use environment variables or encrypted properties for storing SMTP credentials.

    • Do not expose your test SMTP credentials to public-facing applications.

  9. Automate Email Testing in Dev
    Consider building a simple test page in your APEX app where developers can send test emails using sample data. This speeds up verification without triggering real workflows.

  10. Use Application Items for Dynamic Testing
    For greater flexibility, use APEX application items to hold test email addresses or formats. This lets you change values without editing PL/SQL code.

By setting up a safe and controlled email configuration in your Oracle APEX development environment, you ensure that email features are fully tested without the risk of accidentally contacting real users. This practice leads to smoother rollouts and reliable communication when your application goes live.

 Conclusion
Setting up email in a full development environment allows developers to simulate and verify email functionality without risking unintended communication. With proper SMTP configuration, secure handling of credentials, and tools for email testing, you can ensure that all messaging features work correctly before deploying to production—resulting in a smoother, safer development process.

How Do I Configure Email in Oracle APEX

 

Introduction
Configuring email in Oracle APEX allows your applications to send messages such as user notifications, form confirmations, workflow alerts, and system-generated updates. Before sending emails from your APEX apps, you must set up the appropriate SMTP server details and ensure the APEX environment is properly configured. A correct email setup is essential for automating communication and enhancing user engagement.

 Before using email functionality, the APEX instance must be configured to send emails. This is typically done by setting up an SMTP (Simple Mail Transfer Protocol) server.

  • SMTP Host Address: The outgoing mail server that Oracle APEX uses to send emails.

  • SMTP Authentication: If required, provide credentials to authenticate the email sender.

  • SMTP Port: The port number used to connect to the mail server, typically 25, 465 (SSL), or 587 (TLS).

  • Use Secure Connection: Determines if SSL/TLS encryption is used for email communication. 

To configure email in Oracle APEX, you must set up the Simple Mail Transfer Protocol (SMTP) settings that APEX uses to send emails through the APEX_MAIL package. This configuration enables your application to deliver confirmation messages, workflow notifications, or alerts directly to user inboxes. The setup involves both infrastructure-level configuration and application-level PL/SQL logic.

Here is a step-by-step guide on how to configure email in Oracle APEX:

  1. Set Up SMTP Configuration (Instance Level or ORDS)
    Depending on where Oracle APEX is deployed (on-premise, Oracle Cloud, or autonomous database), SMTP settings must be defined:

    • For Oracle Cloud / APEX Service, use the Manage Instance section in APEX Admin:

      • Go to Manage Instance > Instance Settings > Email.

      • Enter:

        • SMTP Host (e.g., smtp.office365.com)

        • Port (e.g., 587 for TLS)

        • Username (e.g., noreply@yourdomain.com)

        • Password (application password or mail server password)

        • SSL/TLS as required by the mail server

    • For On-Premise Using ORDS, edit the ords.defaults.properties file or equivalent configuration file:

      mail.smtp.host=smtp.yourdomain.com
      mail.smtp.port=587
      mail.smtp.username=noreply@yourdomain.com
      mail.smtp.password=yourpassword
      mail.smtp.auth=true
      mail.smtp.starttls.enable=true
      
  2. Verify SMTP Settings
    After saving the settings, restart ORDS (if required) and test by sending a simple email using PL/SQL. If using a cloud setup, the test can be done directly from the APEX interface.

  3. Grant Required Privileges
    Grant the EXECUTE privilege on the APEX_MAIL package to your application schema if it's not already granted:

    GRANT EXECUTE ON APEX_MAIL TO your_schema;
    
  4. Create a Simple PL/SQL Process to Send Email
    Use APEX_MAIL.SEND and APEX_MAIL.PUSH_QUEUE in a PL/SQL block. For example:

    BEGIN
      APEX_MAIL.SEND(
        p_to        => 'user@example.com',
        p_from      => 'noreply@yourdomain.com',
        p_subj      => 'Thank you for your submission',
        p_body      => 'We received your form successfully.',
        p_body_html => '<p>We received your <strong>form</strong> successfully.</p>'
      );
    
      APEX_MAIL.PUSH_QUEUE;
    END;
    
  5. Understand the Mail Queue Behavior
    Oracle APEX queues outgoing emails in a table (APEX_MAIL_QUEUE). Emails are not sent until either:

    • APEX_MAIL.PUSH_QUEUE is called, or

    • The automated mail queue job runs (if scheduled using DBMS_SCHEDULER or the ORDS environment supports automatic pushing)

  6. Monitor and Debug Email Status

    • Check APEX_MAIL_LOG for delivery status and errors

    • Check APEX_MAIL_QUEUE for pending messages

    • Example:

      SELECT * FROM APEX_MAIL_LOG ORDER BY SENT_DATE DESC;
      
  7. Tips for Success

    • Always use a verified domain that has proper SPF and DKIM records to prevent messages from being flagged as spam.

    • If testing with Gmail, Outlook, or Office365, use app-specific passwords or OAuth-based mail accounts.

    • Make sure firewalls or network security rules allow SMTP traffic from the APEX server.

  8. Use HTML and Text Bodies Together
    To ensure compatibility with all email clients, always send both p_body (plain text) and p_body_html (HTML formatted message).

  9. Use Substitution Strings for Dynamic Content
    Customize email content using page items, application items, or SQL query results:

    APEX_MAIL.SEND(
      p_to        => :P1_EMAIL,
      p_from      => 'noreply@yourdomain.com',
      p_subj      => 'Hello ' || :P1_NAME,
      p_body      => 'Dear ' || :P1_NAME || ', your request has been received.',
      p_body_html => '<p>Dear ' || :P1_NAME || ',<br>Your request has been received.</p>'
    );
    

By following these steps, you configure Oracle APEX to send emails using the APEX_MAIL package and SMTP settings. With correct setup and permissions, your APEX applications can automate communications and improve user interaction through reliable email delivery.

Conclusion
By successfully configuring email in Oracle APEX, you unlock the ability to send real-time, automated messages that improve the functionality and responsiveness of your application. With the right SMTP settings in place and proper use of the APEX_MAIL package, your app can deliver critical information to users efficiently and reliably.

How To Use Email Delivery Works in Oracle APEX

 

Introduction
Email delivery in Oracle APEX allows your applications to send notifications, confirmations, alerts, and reports directly to users’ inboxes. Whether triggered by form submissions, scheduled processes, or workflow events, integrating email functionality enhances communication and automates important interactions. Understanding how APEX handles email—from configuration to sending—is essential for creating responsive, user-friendly applications.

 
  1. User or System Triggers an Email

    • A user action, a scheduled job, or a system event calls the APEX_MAIL.SEND procedure to send an email.

  2. Email is Placed in the APEX Mail Queue

    • APEX does not send emails immediately. Instead, they are added to a queue and processed asynchronously.

  3. Oracle APEX Processes the Queue

    • The APEX_MAIL.PUSH_QUEUE procedure sends the queued emails via the configured SMTP server.

  4. SMTP Server Delivers the Email

    • The SMTP server authenticates and delivers the email to the recipient's email provider.

  5. Recipient Receives the Email

    • The recipient’s email provider processes the email and delivers

Using email delivery in Oracle APEX enables applications to send emails to users for notifications, alerts, confirmations, and workflow-related messages. This functionality is commonly used for contact forms, approval processes, password resets, and scheduled reports. Oracle APEX provides built-in support through the APEX_MAIL package, which works with your configured SMTP server to send email messages from your application.

Here is a detailed explanation of how email delivery works in Oracle APEX:

  1. Configure SMTP Settings
    Before sending emails, you must configure the SMTP server details for your APEX instance.
    If you are using Oracle APEX on Oracle Cloud or on an on-premise Oracle REST Data Services (ORDS) setup, the SMTP settings must be configured in the instance settings or at the Web Listener level.

    For ORDS-managed environments:

    • Edit the ords.war or configuration files to set the SMTP host, port, username, password, and secure connection options (TLS/SSL).

    • You can also use Oracle APEX Instance Administration to enter the SMTP server and port in Manage Instance > Instance Settings > Email.

  2. Grant Access to APEX_MAIL
    Ensure that the schema owning your application has the necessary privileges:

    GRANT EXECUTE ON APEX_MAIL TO your_schema;
    
  3. Compose and Send an Email Using APEX_MAIL
    You can use the APEX_MAIL.SEND procedure in a PL/SQL process (e.g., on page submit or after insert). Here's an example:

    BEGIN
      APEX_MAIL.SEND(
        p_to        => 'user@example.com',
        p_from      => 'noreply@yourdomain.com',
        p_subj      => 'Confirmation',
        p_body      => 'Thank you for submitting the form.',
        p_body_html => '<p>Thank you for <strong>submitting</strong> the form.</p>'
      );
    
      APEX_MAIL.PUSH_QUEUE;
    END;
    
    • p_to: recipient email address

    • p_from: sender’s email (must match the SMTP sender policy)

    • p_subj: subject line

    • p_body: plain text body

    • p_body_html: HTML version (optional but recommended for rich formatting)

  4. Push the Mail Queue
    Emails are queued in the APEX_MAIL_QUEUE table and not sent immediately unless you explicitly call:

    APEX_MAIL.PUSH_QUEUE;
    

    Alternatively, the background job that pushes mail from the queue can be configured to run periodically using DBMS_SCHEDULER or ORDS.

  5. Check the Mail Queue and Logs
    You can monitor the email status from these views:

    • APEX_MAIL_LOG – for success/failure status of sent emails

    • APEX_MAIL_QUEUE – for pending emails waiting to be sent

    Example:

    SELECT * FROM APEX_MAIL_LOG ORDER BY SENT_DATE DESC;
    
  6. Use Bind Variables and Dynamic Content
    You can personalize the email content by embedding data from application items or table rows. Use v() to refer to items or construct messages dynamically within PL/SQL.

    Example:

    DECLARE
      l_message VARCHAR2(4000);
    BEGIN
      l_message := 'Dear ' || :P1_NAME || ', thank you for registering.';
      APEX_MAIL.SEND(
        p_to        => :P1_EMAIL,
        p_from      => 'noreply@yourdomain.com',
        p_subj      => 'Welcome!',
        p_body      => l_message
      );
      APEX_MAIL.PUSH_QUEUE;
    END;
    
  7. Security and Best Practices

    • Ensure you do not expose SMTP credentials.

    • Validate and sanitize email inputs to prevent misuse.

    • Use a domain and email sender that matches your organization’s SPF/DKIM setup to prevent messages from being flagged as spam.

    • Use p_body_html for rich emails and always include p_body as a fallback.

By properly configuring your SMTP settings and using APEX_MAIL, you can build automated email workflows directly into your APEX applications. Whether you are sending alerts, approval notices, or customer confirmations, this functionality brings real-time communication to your users and supports a modern, interactive application experience.

Conclusion
Using email delivery in Oracle APEX adds powerful communication features to your application. By configuring SMTP settings, building dynamic content, and leveraging PL/SQL APIs like APEX_MAIL, you can automate messaging with precision and reliability. This ensures that users stay informed, engaged, and connected to the application’s processes in real time.

UI Defaults

 In Oracle APEX, User Interface (UI) Defaults are a set of metadata-driven, table- and column-scoped attributes that APEX consults when it g...