Skip to Main Content

New

Oracle APEX – Email Sending Process

Published on 27 Dec 2025 by CHATURVEDINIDHI26@GMAIL.COM


           Oracle APEX – Email Sending Process        

Oracle APEX – Email Sending Process

   

1. Introduction

   

This document explains how email works in Oracle APEX, how mail is sent, how to verify mail status, how to debug issues, and the common reasons why mail may not be delivered, along with solutions.

   

This document is suitable for:

   
           
  • Technical posting (LinkedIn / internal knowledge sharing)
  •        
  • Team onboarding
  •        
  • Client explanation
  •        
  • Production support reference
  •    
   
   

2. What is the Oracle APEX Mail Process?

   

Oracle APEX provides a built-in package called APEX\_MAIL to send emails from applications.

   

The mail process works in the following stages:

   
           
  1. Mail Creation – Mail request is created using APEX\_MAIL.SEND
  2.        
  3. Mail Queue – Mail is temporarily stored in APEX\_MAIL\_QUEUE
  4.        
  5. Mail Processing – SMTP server picks the mail
  6.        
  7. Mail Logging – Final status is stored in APEX\_MAIL\_LOG
  8.    
   
   

3. How Email is Sent in Oracle APEX

   

Step 1: Send Mail Using PL/SQL

   
  
DECLARE  
   l\_mail\_id NUMBER;  
BEGIN  
   l\_mail\_id := apex\_mail.send(  
       'user@example.com',                -- TO  
       'itsupport@company.com',           -- FROM  
       'Test Mail from Oracle APEX',      -- SUBJECT  
       'This is a test email.'            -- BODY  
   );

   apex\_mail.push\_queue;  
END;  
/  
   
   

Step 2: What Happens Internally

   
           
  • Mail request is created
  •        
  • Entry is added to APEX\_MAIL\_QUEUE
  •        
  • SMTP sends the mail
  •        
  • Entry is removed from queue
  •        
  • Final result is written to APEX\_MAIL\_LOG
  •    
   
   

4. How to Check if Mail Was Sent

   

4.1 Check Mail Log (Most Important)

   
  
select  
   mail\_id,  
   mail\_to,  
   mail\_from,  
   mail\_subj,  
   mail\_message\_send\_end,  
   mail\_send\_error  
from apex\_mail\_log  
order by mail\_id desc;  
   
   

Interpretation:

   
           
  • MAIL\_MESSAGE\_SEND\_END populated → Mail processed
  •        
  • MAIL\_SEND\_ERROR is NULL or '-' → No error
  •    
   
   

5. Why APEX\_MAIL\_QUEUE Can Be Empty

   

This is normal behavior.

   
           
  • APEX\_MAIL\_QUEUE only contains pending mails
  •        
  • After successful send, records are deleted
  •        
  • History is always available in APEX\_MAIL\_LOG
  •    
   
   

6. How to Debug if Mail Is Not Sent

   

Step 1: Check EMAIL\_ENABLED

   
  
select value  
from apex\_instance\_parameters  
where parameter\_name = 'EMAIL\_ENABLED';  
   
   

Expected value: Y

   

Step 2: Check SMTP Configuration

   
  
select parameter\_name, value  
from apex\_instance\_parameters  
where parameter\_name like 'SMTP%';  
   
   

SMTP must be configured correctly.

   

Step 3: Check Mail Log for Errors

   
  
select mail\_send\_error  
from apex\_mail\_log  
where mail\_send\_error is not null;  
   
   
   

7. Common Reasons Why Mail Is Not Delivered & Solutions

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
ReasonExplanationSolution
EMAIL\_ENABLED = NMail feature disabledEnable EMAIL in APEX Admin
SMTP not configuredNo mail serverConfigure SMTP host & port
Invalid FROM addressDomain not allowedUse authorized domain email
Spam filteringMail delivered but blockedCheck Spam/Junk folder
SPF/DKIM missingDomain authentication issueConfigure SPF & DKIM
Corporate firewallExternal mail blockedAllow SMTP traffic
Wrong parametersSEND procedure mismatchUse positional parameters
No COMMITMail not finalizedCall apex\_mail.push\_queue
   
   

8. Best Practices for APEX Email

   
           
  • Always verify mail using APEX\_MAIL\_LOG
  •        
  • Use domain-based FROM email
  •        
  • Use positional parameters for compatibility
  •        
  • Commit business data before sending mail
  •        
  • Avoid page items in background processes
  •    
   
   

9. Production Checklist

   
           
  • SMTP configured and tested
  •        
  • EMAIL\_ENABLED = Y
  •        
  • FROM email domain authorized
  •        
  • Spam policy validated
  •        
  • Mail logging monitored
  •    
   
   

10. Conclusion

   

Oracle APEX provides a reliable and traceable email mechanism using APEX\_MAIL.

   

If mail appears in APEX\_MAIL\_LOG, it means:

   
           
  • ✔ Mail request created
  •        
  • ✔ SMTP accepted the mail
  •        
  • ✔ APEX processing completed successfully
  •    
   

Any delivery issue beyond this point is related to the email server or security policies, not Oracle APEX.

   
   

Prepared For: Technical Posting & Knowledge Sharing
   Prepared By: IT Support Team

📝 Nidhi Blog

Sharing knowledge, tutorials, and stories about Oracle APEX, development, and digital growth.

📧 Contact

Email: support@nidhispace.com

Follow us on:
linkedin | YouTube


© Nidhi Blog. All rights reserved.