Send Mail from Free-Tier

Send Mail from Free-Tier

Configuration Steps
See here:
https://docs.oracle.com/en/cloud/paas/autonomous-database/adbsa/apex-send-email.html
And here:
Sending Email from your Oracle APEX App on Autonomous Database

  1. In Oracle Cloud https://cloud.oracle.com/identity/users/

Add SMTP Credentials:

  1. copy username and password into

connect as ADMIN to the database

BEGIN
    APEX_INSTANCE_ADMIN.SET_PARAMETER('SMTP_HOST_ADDRESS', 'smtp.email.eu-frankfurt-1.oci.oraclecloud.com');
    APEX_INSTANCE_ADMIN.SET_PARAMETER('SMTP_USERNAME', 'ocid1.user.oc1..xxxx@ocid1.tenancy.oc1..xxxx.gm.com');
    APEX_INSTANCE_ADMIN.SET_PARAMETER('SMTP_PASSWORD', 'H90uUK+xxxxxxx;');
    COMMIT;
END;
/

And then test it:


BEGIN
    APEX_INSTANCE_ADMIN.VALIDATE_EMAIL_CONFIG;
END;
/

=> no errors => no problems ;-)

But... dont use @gmail adresses

Try to send email


declare 
  l_workspace_id number;
BEGIN
    l_workspace_id := apex_util.find_security_group_id('YOURWKSPNAME');
    apex_util.set_security_group_id(l_workspace_id);

    APEX_MAIL.SEND(p_from => 'irgendwas@mustermann.at',
                   p_to   => 'txsaxxaas@gmail.com',
                   p_subj => '2 from Oracle Database',
                   p_body => 'Sent using APEX_MAIL');
   apex_mail.push_queue(); 
END;
/

nothing happens - also no entires in apex mail queue



select * from APEX_MAIL_QUEUE;
rows found

select * from APEX_MAIL_LOG;
no rows found

.. investigation

Has the user email approved been entered?

I see in the Email Approved Senders that I haven't defined an SPF.

As I am registered with Cloudpit, I need to create a TXT entry for my domain here. So, I'll try using this setting:

What does Oracle say now?

no SPF found.. maybe i have too wait a little..

But i will retry sending an email.. and now:

ohohoh.. Email arrived ...

yess..