There are similar blogs on this subject, however this one gives you:
Up to date OCI steps, as of 2024 & APEX 23.2
A separate OCI User dedicated to email sending
Separate OCI Group & Policies for Email Management
Custom Domain configuration with DKIM & SPF
Cloudflare / DNS Configuration
Configuration of the Email Server in APEX Instance Settings
Testing of Emailing with APEX
Steps
The following steps steps are required
Create a Group, Policy, User & SMTP Credentials
Search for Groups
Click Groups > Create Group > Email-Senders
Search for Policies. Click Services > Policies
Click Create Policy
In the Name, type Email-Senders-Policy
In the Description, type Email-Senders-Policy
In Policy use cases select Email Management
In Groups, select group Email-Senders.
In Location, Select Root
It should look like this
Click Create
Search for Email and click on Services > Users (yes. Users, not email)
Click Create User
Create a User with these Details
Click on Groups > Add User to Group > Email-Senders and Click Add
Click on SMTP Credentials
Click Generate SMTP Credentials and complete the form as below
Click Generate SMTP Credentials button
Copy both the Username and Password to your password manager
Click Close
Configure Email Delivery
Search for Email and click on Services > Email Delivery
Click Create Configuration
Copy the details displayed to notepad
Click Email Domain > Create Email Domain
Enter your Domain Name and click Create Email Domain
Click Add DKIM
Step 1:
Enter a DKIM Selector of your prefix-tenancy-yyymm e.g luf-leedsunited-202401Step 2:
Click Generate DKIM RecordStep 3:
Copy the CNAME Record and CNAME Values to notepadClick Create DKIM
Add the following CNAME record to your DNS setup for your Domain. Here is a picture from my Cloudflare dashboard. IMPORTANT: If using Cloudflare, the Proxy Status needs to be off . i.e as per the picture below and not orange.
Create a TXT with the value from this link for your region. e.g. I'm choosing the europe link below.
Back in OCI, it'll look like this
Make a cuppa ☕ whilst everything propagates. It's a lovely day out there 🌤️
Move to the next step when DKIM in OCI looks like this...
Move to the next step when SPF in OCI looks like this...
Click Approved Senders > Create Approved Senders
Create a Sender Email address, e.g do.not.reply@yourdomain.com
Click Create Approved Sender and check the email was created correctly
Configure APEX
Log on to Internal Workspace in APEX
Click on Manage Instance > Instance Settings > Email
In SMTP Host Address type in the Public Endpoint you noted from the Configuration Step earlier e.g
smtp.email.eu-frankfurt-1.oci.oraclecloud.com
In SMTP Host Port type in the Port you noted from the Configuration Step earlier e.g
587
In SMTP Authentication Username type in the Username you copied when you created the SMTP_USER e.g
ocid1.user.oc1..aaa
In SMTP Password type in the Password you copied when you created the SMTP_USER e.g
EllandRoad
Enter the Password again into Confirm SMTP Password
Keep the TLS setting as After connection is established or as otherwise advised in the Configuration Step earlier
In Default Email From Address enter the Approved Sender email address
Testing APEX
In APEX Create a simple Send E-Mail Process to test email. Configure as below, however use a From Email Address as the Approved Sender email address
Create a Button to submit the page.
Run the page, click the submit button
Check in Internal Workspace > Manage Instance > Mail Queue
Check your email. Check your spam too.
Troubleshooting
Below are the typical issues encountered setting this up
Cloudflare Proxy needs to be off otherwise the DKIM Signing Status will never turn to Active
ORA-29279: SMTP permanent error: 535 Authorization failed: Envelope From address not authorized. This was due to the Policy not been in place and assigned to the email-senders group
ORA-29278: SMTP transient error: 421 Too many auth failures, try again later
orSMTP permanent error: 533 Authorization failed: Envelope from address <address> not authorized
can be attributed to not adding the SMTP_USER to the Email-Senders Group. Try adding the user to the group, then wait about an hour for the421
error to go away and try again.
ENJOY!
Of course, I don't' manage the cloud account for The Peacocks. It was just a simulation.
What's the picture? It's St. Andrews Church at Blubberhouses. Yes, there is an actual place called Blubberhouses. Visit Yorkshire!