Page 1 of 1

Email from Oracle Autonomous Database Script

Posted: Thu Dec 30, 2021 2:39 am
by admin
BEGIN
APEX_INSTANCE_ADMIN.SET_PARAMETER('SMTP_HOST_ADDRESS', 'smtp.us-phoenix-1.oraclecloud.com');
APEX_INSTANCE_ADMIN.SET_PARAMETER('SMTP_USERNAME', 'ocid1.user.oc1.username');
APEX_INSTANCE_ADMIN.SET_PARAMETER('SMTP_PASSWORD', 'password');
APEX_INSTANCE_ADMIN.SET_PARAMETER('SMTP_HOST_PORT',587);
COMMIT;
END;
/

NOTE: Keep default values for SMTP_HOST_PORT parameter (587) and SMTP_TLS_MODE parameter (STARTTLS).

BEGIN
APEX_INSTANCE_ADMIN.VALIDATE_EMAIL_CONFIG;
END;
/

NOTE: If any errors are reported (for example, "ORA-29279: SMTP permanent error: 535 Authentication credentials invalid"), adjust the SMTP parameters and repeat the validation step.

BEGIN
APEX_MAIL.SEND(p_from => 'info@erpstuff.com',
p_to => 'sikandar@erpstuff.com',
p_subj => 'Email from Oracle Autonomous Database',
p_body => 'Sent using APEX_MAIL by ERPstuff.com');
END;
/

https://docs.oracle.com/en/cloud/paas/a ... CC2DB5B73E