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.
Identify the SMTP Endpoint
The SMTP host address must be obtained from OCI Email Delivery settings.
Generate SMTP Credentials
SMTP credentials are needed to authenticate email requests.
Create an Approved Sender
Only approved sender email addresses can be used in APEX.
Set SMTP Parameters in APEX
- Use the APEX_INSTANCE_ADMIN.SET_PARAMETER procedure to configure SMTP settings.
Here’s a detailed step-by-step guide:
-
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.
-
-
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.
-
-
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.
-
-
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) or465
(SSL) -
Username: The generated OCI SMTP username
-
Password: The generated OCI SMTP password
-
-
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.
-
-
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;
-
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;
-
-
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.
No comments:
Post a Comment