Introduction
Setting up Oracle Cloud Infrastructure (OCI) Email Delivery in Oracle APEX allows your applications to send transactional and notification emails using Oracle’s secure and scalable cloud-based email service. This integration is ideal for organizations seeking high deliverability, built-in security, and control over sending domains. By configuring OCI Email Delivery correctly, APEX developers can ensure that outgoing messages are authenticated, trusted, and reliably received by users.
To set up Oracle Cloud Infrastructure (OCI) Email Delivery in Oracle APEX, you must first configure your OCI account for email sending, obtain SMTP credentials, and then apply those credentials within your APEX environment. This allows APEX applications to send authenticated emails using Oracle's secure and scalable mail delivery service.
Here is a detailed step-by-step guide:
-
Set Up OCI Email Delivery in Oracle Cloud Console
-
Log in to your Oracle Cloud Console.
-
Open the Email Delivery service from the navigation menu.
-
Create an Approved Sender by specifying the email address you want to send from.
-
Navigate to Email Delivery > Approved Senders.
-
Click Create Approved Sender, enter your sender email address (e.g.,
noreply@yourdomain.com
), and submit. -
Ensure this address matches the one you will use as the sender in APEX.
-
-
-
Create SMTP Credentials for a User
-
Go to Identity & Security > Users, and select the user who will send emails.
-
Click SMTP Credentials, then Generate SMTP Credentials.
-
Note down the generated Username and Password. This password is shown only once.
-
These credentials are what APEX will use to authenticate with the OCI SMTP server.
-
-
Verify Your Domain (Optional but Recommended)
-
If sending from a custom domain, configure SPF, DKIM, and DMARC records in your DNS provider.
-
This helps prevent emails from being marked as spam and improves deliverability.
-
Oracle provides DKIM key pairs and instructions under the Email Domain settings.
-
-
SMTP Server Details for OCI Email Delivery
Use the following settings in APEX:-
SMTP Host:
smtp.email.us-ashburn-1.oci.oraclecloud.com
(or your region-specific endpoint) -
Port:
587
(for TLS) -
SMTP Username: the one generated in step 2
-
SMTP Password: the one generated in step 2
-
Enable STARTTLS/TLS encryption
-
-
Configure SMTP in Oracle APEX
-
Navigate to Manage Instance > Instance Settings > Email
-
Enter the following:
-
SMTP Host Address:
smtp.email.<region>.oci.oraclecloud.com
-
SMTP Port:
587
-
Use TLS: Yes
-
SMTP Username: paste from step 2
-
SMTP Password: paste from step 2
-
Default From Email Address: must match the approved sender email
-
-
Save the configuration
-
-
Test Email from APEX
Use a PL/SQL block to send a test email:BEGIN APEX_MAIL.SEND( p_to => 'user@example.com', p_from => 'noreply@yourdomain.com', p_subj => 'OCI Email Delivery Test', p_body => 'This email was sent from Oracle APEX using OCI Email Delivery.' ); APEX_MAIL.PUSH_QUEUE; END;
Verify that the recipient receives the message.
-
Monitor and Maintain
-
Check email logs using the APEX_MAIL_LOG view.
-
Monitor sending quotas and limits in the OCI Email Delivery dashboard.
-
Rotate SMTP credentials regularly and revoke them if compromised.
-
Security Notes
-
Always use TLS or STARTTLS encryption to protect SMTP traffic.
-
Use secure methods for storing SMTP credentials (avoid hardcoding them in PL/SQL).
-
Monitor usage in OCI to avoid abuse or unintended use of your sending domain.
By properly setting up OCI Email Delivery in Oracle APEX, your applications can send emails that are trusted, secure, and reliably delivered. This configuration aligns with enterprise-grade practices and is highly recommended for production applications.
For applications hosted on Oracle Cloud, OCI Email Delivery is the recommended SMTP provider.
SMTP Server: smtp.us-phoenix-1.oraclecloud.com (or the region-specific endpoint)
Port: 587 (TLS)
Encryption: TLS
Authentication: Required
Username: Oracle Cloud SMTP credential user
Password: Oracle Cloud SMTP credential password
To configure OCI Email Delivery in Oracle APEX:
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', 'your_smtp_password');
APEX_INSTANCE_ADMIN.SET_PARAMETER('SMTP_HOST_PORT', '587');
APEX_INSTANCE_ADMIN.SET_PARAMETER('SMTP_TLS_MODE', 'STARTTLS');
COMMIT;
END;
/
Conclusion
Integrating OCI Email Delivery with Oracle APEX provides a powerful and secure way to handle email communications within your applications. With proper setup—including SMTP credentials, verified sender domains, and secure connections—you gain full control over email behavior while leveraging the reliability of Oracle’s infrastructure. This setup ensures consistent delivery, improves sender reputation, and supports a professional communication framework for all APEX-based systems.
No comments:
Post a Comment