Skip to Main Content
  • Questions
  • How can I register my SMTP service in Oracle Apex?

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, Edisson.

Asked: January 13, 2022 - 8:19 pm UTC

Last updated: January 24, 2022 - 2:17 am UTC

Version: 21.1

Viewed 1000+ times

You Asked

In the company where I work, we have the services of JD Edwards and Orchestrator Studio, but we are using APEX for fast applications. The problem is that we have not managed to use the JD Edwards SMTP in APEX or an external one to test that the apex_mail.send() function works and so far we have not succeeded, and we watched videos and followed the steps and nothing and the documentation offered by Oracle is not entirely clear even confusing that you have to do, another thing we tried was to create a service in Orchestrator Studio and it works with JS the drawback is that the code is on the client side and not the server and the alternative was to use UTL_HTTP or apex_web_service. make_rest_request() and neither as I read that UTL_HTTP has some limits with apex and apex_web_service.make_rest_request() blocks the service because the URL is not secure.

I have read most of the forum and nothing I can do to make it send APEX mails because it really depends on a database developer to do that and I have been using this tool for a very short time. I do not know if you could help me which are the steps I must follow to be able to send mails with APEX as in Cloud and in my local machine (localhost).


Sources consulted:

https://docs.oracle.com/en/database/oracle/application-express/21.1/aeapi/Configuring-Oracle-Application-Express-to-Send-Email.html#GUID-596E11FE-9289-4238-A3CA-D33F508E40F7

https://stackoverflow.com/questions/65528885/invoke-a-rest-api-json-in-plsql

https://www.youtube.com/watch?v=sI37Be2EZhk

https://technology.amis.nl/database/invoke-a-rest-service-from-plsql-make-an-http-post-request-using-utl_http-in-oracle-database-11g-xe/


and Connor said...

I'm not entirely sure I understand exactly the requirement you are trying to meet, but I'm going to assume the aim (at least initially) is just to send an email from APEX.

For that, the best resource out of the ones you've listed is Tim's video.

Can you post here (as a review) what you've done for each of the steps in the video (anonymising details where appropriate) so we can see what you've tried/done, and then we'll try assist more, ie

- the APEX instance settings you've done
- wallet
- network ACL
- anonymous block in SQLcl/SQLPlus you've run to test mail

Rating

  (1 rating)

Is this answer out of date? If it is, please let us know via a Comment

Comments

Steps to follow

Edisson Lopez, January 20, 2022 - 10:16 pm UTC

Hi,

1. One of my clients has JD Edwards and implemented Apex(i believe is using weblogic) and it is necessary to send mails using Apex to an application, I already notified to infrastructure department to watch the video and to follow the steps.
- wallet (I saw a post about what the dba has to do to configure it, but it looks complex, please send me documentation to refer to)
- network ACL(please send me documentation to refer to)


2. I have a free instance of Apex in Cloud and what I understand the wallet is already configured. But I don't know if the same process of the video applies.

3. I have a rest service for sending emails with javascript, due to vulnerability issues. How I can implement this consumption of my rest service in apex with PL/SQL?

Please check following and more information:
https://community.oracle.com/tech/developers/discussion/comment/16821950#Comment_16821950

Connor McDonald
January 24, 2022 - 2:17 am UTC

1)

Tim's video is based on an existing blog post of his

https://oracle-base.com/articles/misc/email-from-oracle-plsql

which walks through the exact commands to run. However, I generally recommned that people should just install APEX ... even if they never plan to use it, and then just use APEX_MAIL instead.

2)

For autonomous, we preload common certificates. There's a few setup steps to do

https://docs.oracle.com/en/cloud/paas/autonomous-database/adbsa/apex-send-email.html


3)

Manage Instance -> Security -> HTTP Protocol -> Require Outbound HTTPS -> No.

But for obvious reasons we don't recommend that

More to Explore

APEX

Keep your APEX skills fresh by attending their regular Office Hours sessions.