Skip to Main Content
  • Questions
  • Setup Apex 22.1 email with MS O365 Outlook SMTP

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, Rahul.

Asked: May 21, 2025 - 9:50 pm UTC

Last updated: June 03, 2025 - 1:35 am UTC

Version: 22.1

Viewed 1000+ times

You Asked

I am trying to integrate Microsoft Office365 Outlook's SMTP with Oracle Apex 22.1(Running on Amazon RDS for Oracle 19c).
I have used the following configuration on Apex:
SMTP server name: smtp.office365.com
SMTP port: 587
Username: <my-email-id@outlook.com>
Password: <generated App password after 2 factor authentication>
use TLS: Yes

I have uploaded the correct MS root and intermediate certificates to the auto-login wallet and created required Netwrok ACLs.
When I try to send email using Apex (SQLPLUS), I do not get any error but the email never reaches the inbox instead the MAIl QUEUE in Apex gets populated.

begin
apex_util.set_security_group_id (p_security_group_id => 5140893825405459);
APEX_MAIL.SEND(p_from => 'awsrahul2024@outlook.com',
p_to => 'awsrahul2024@outlook.com',
p_subj => 'Test Mail2',
p_body => 'This is a test email');
apex_mail.push_queue();
END;
/

PL/SQL procedure successfully completed.

When I try to validate the email configuration, I get the following error.

SQL> begin
APEX_INSTANCE_ADMIN.validate_email_config;
end; 2 3
4 /
begin
*
ERROR at line 1:
ORA-29279: SMTP permanent error: 535 5.7.139 Authentication unsuccessful, basic
authentication is disabled. [BM1P287CA0002.INDP287.PROD.OUTLOOK.COM
2025-05-21T21:47:12.528Z 08DD989AFE00C8F6]
ORA-06512: at "APEX_220100.WWV_FLOW_MAIL", line 1284
ORA-06512: at "SYS.UTL_SMTP", line 57
ORA-06512: at "SYS.UTL_SMTP", line 142
ORA-06512: at "SYS.UTL_SMTP", line 446
ORA-06512: at "APEX_220100.WWV_FLOW_MAIL", line 1268
ORA-06512: at "APEX_220100.WWV_FLOW_MAIL", line 2588
ORA-06512: at "APEX_220100.WWV_FLOW_INSTANCE_ADMIN", line 1671
ORA-06512: at line 2


Kindly advise. Thank you!

and Connor said...

As the error suggests, it looks like basic authentication is no longer possible to outlook.com. As per

https://support.microsoft.com/en-au/office/pop-imap-and-smtp-settings-for-outlook-com-d088b986-291d-42b8-9564-9c414e2aa040

"Outlook.com requires the use of Modern Auth / OAuth2. Basic auth is in the process of being deprecated from the Outlook.com service."

We did a video recently about integrating APEX with both Slack and Outlook - its more complicated because we're using REST to handle to authentication and transmission, but you can see the details on how to setup access to the relevant APIs



Given that perhaps many internet email providers might head this way, perhaps log an idea in the APEX ideas app https://apex.oracle.com/ideas

Rating

  (2 ratings)

Comments

Rahul, May 23, 2025 - 11:13 am UTC

Thank you Sir, for your great advice and sharing the video link !

I am also hoping for Oracle to come up with a native solution of handshaking with MS O365 oAuth2 SMTP like we currently have for username/pwd based basic authentication. This would allow much simpler instance wide usage of email exchange, independent of individual Apex apps and without the need of using REST api based granular approach.

Thank you again!

Rahul
Chris Saxon
May 23, 2025 - 12:37 pm UTC

You're welcome - as Connor says submit your suggestion on the APEX ideas forum to bring it to their attention.

A reader, May 29, 2025 - 10:17 am UTC

Thank you! I did post the idea on Apex Ideas app. No luck there.

"We reviewed this idea carefully, and while it was interesting, we concluded that it is unlikely to make its way into APEX in the foreseeable future."

https://apexapps.oracle.com/pls/apex/r/apex_pm/ideas/details?idea=FR-4478&session=109351301575018

Connor McDonald
June 03, 2025 - 1:35 am UTC

I'm sorry that didnt work out. I'll ask around internally, but I do know that the team gives all ideas a thorough review.

More to Explore

PL/SQL demos

Check out more PL/SQL tutorials on our LiveSQL tool.

PL/SQL docs

PL/SQL reference manual from the Oracle documentation library