How to send mail from Oracle APEX

In this tutorial i will show you how to send mail from Oracle APEX. Lets start….

This tutorial divide into tree parts-

  1. Configure mail server
  2. Enabling network services
  3. Test mail

1. Configure mail server: Before you configure Oracle APEX mail server you need to a SMTP mail server username and password. Then login your oracle apex admin panel. After login Oracle APEX admin panel then go to manage instance > instance settings > mail.


Configure mail server as below:

2. Enabling Network Service: By default, the ability to interact with network services is disabled in Oracle Database 11g or later. Therefore, you must use the BMS_NETWORK_ACL_ADMIN package to grant connect privileges to any host for the database user. In this tutorial i will create network service for APEX 4.x power user that means APEX_040200 (Power user for APEX 5 is APEX_050000):

3. Send Mail: Oracle application express send mail using APEX_MAIL package. example…

Send mail with attachments…

Thanks for visit. Happy apexing……

Tags: , ,
Ali Asgor

Graduate in GES, OCP holder, Self-motivated app developer, Programming lover, Lazy person...

You may also like


  • sohel
    August 2, 2016 at 5:36 pm

    where do i find or create “SMTP mail server username and password”

    • Ali Asgor
      Ali Asgor
      August 3, 2016 at 8:21 am

      If u use gmail as mail server, then configuration like
      SMTP server:
      SMTP username: Your full gmail address (e.g.
      SMTP password: Your Gmail password
      SMTP port: 465

      Or if own mail server, then configure like
      SMTP server: or
      SMTP username: Your full email address (e.g.
      SMTP password: Your email password
      SMTP port: 25/26

      • jaws
        August 23, 2016 at 3:49 pm

        Does this only need to apply to the original server?
        Such as mine if I am building it, or will it need to change with the server it is on?
        My users use many different servers between themselves.

  • Hai Pham
    August 23, 2016 at 9:34 am

    Dear !
    But i got error : ORA-29024: Certificate validation failure
    I use zoho mail. and port 465 (SSL)

    How to resolve it? Could you help me?

    • Ali Asgor
      Ali Asgor
      August 28, 2016 at 10:46 am

      You need to install a certificate on APEX Admin panel. U can use oracle wallet manager to install a certificate. Settings through Manage Instance > Instance Setting > Wallet

  • Ahmed
    October 13, 2016 at 11:48 am

    I’m getting this error
    ORA-29279: SMTP permanent error: 530 5.7.0 Must issue a STARTTLS command first. f2sm21861492wjr.2 – gsmtp

    My Apex Release is 4.2.6 and Database 11.2.0

  • Dijomon Vrghese
    January 6, 2017 at 6:34 am

    ‘ ORA-29278: SMTP transient error: 421 Service not available ‘….

  • Irfan
    April 27, 2018 at 7:50 am

    ERROR at line 1:
    ORA-20001: This procedure must be invoked from within an ap
    ORA-06512: at “APEX_050000.WWV_FLOW_MAIL”, line 562
    ORA-06512: at “APEX_050000.WWV_FLOW_MAIL”, line 588
    ORA-06512: at “APEX_050000.WWV_FLOW_MAIL_API”, line 97



Follow Me

Oracle Certification