How to use CDO with Microsoft Access VBA to send email with M365 Hosted Enterprise Email with Organization SSO - Stack Overflow

General Question:How do you use CDO with VBA to send messages using Microsoft 365 Hosted Enterprise Em

General Question:

How do you use CDO with VBA to send messages using Microsoft 365 Hosted Enterprise Email that uses Single Sign On and MFA to send messages from a resource/departmental account?

Background:

Currently I use the built in COM & Outlook Object Model automation to send emails from Microsoft Access with Microsoft Outlook via VBA. Unfortunately, the "New" Outlook apps for Windows no longer support VBA Macros, COM Add-ins, Outlook Object Model (OOM) and Messaging Application Programming Interface (MAPI) technologies.

While the "Classic" Outlook is still available, the default install is the "New" Outlook and its extremely limited functionality. Therefore, I cannot be sure that my users will actually have Classic Outlook installed or configured on their systems.

As such, I have been reviewing online documentation and there have been suggestions to use CDO (Collaboration Data Objects) to send email via VBA outside of Outlook. New Outlook – The Situation in December 2024, Access Forever: Info and Ideas on Microsoft Access (see Bullet B) and Sending Emails from Access with VBA and CDO, Philipp Stiefel

Problem:

Our anization uses Microsoft 365 Cloud Email with MFA. When we set up our accounts in Outlook, Activate MS Office or access any of the Microsoft 365 web-based apps/services, we would get the Microsoft login screen and when we enter our username/email it would redirect us to our Organization's SSO portal to sign-in and then back to app where we complete the MFA.

How can we implement CDO in this scenario. If there is no way to do this, what would be the alternatives for sending email via VBA Automation?

General Question:

How do you use CDO with VBA to send messages using Microsoft 365 Hosted Enterprise Email that uses Single Sign On and MFA to send messages from a resource/departmental account?

Background:

Currently I use the built in COM & Outlook Object Model automation to send emails from Microsoft Access with Microsoft Outlook via VBA. Unfortunately, the "New" Outlook apps for Windows no longer support VBA Macros, COM Add-ins, Outlook Object Model (OOM) and Messaging Application Programming Interface (MAPI) technologies.

While the "Classic" Outlook is still available, the default install is the "New" Outlook and its extremely limited functionality. Therefore, I cannot be sure that my users will actually have Classic Outlook installed or configured on their systems.

As such, I have been reviewing online documentation and there have been suggestions to use CDO (Collaboration Data Objects) to send email via VBA outside of Outlook. New Outlook – The Situation in December 2024, Access Forever: Info and Ideas on Microsoft Access (see Bullet B) and Sending Emails from Access with VBA and CDO, Philipp Stiefel

Problem:

Our anization uses Microsoft 365 Cloud Email with MFA. When we set up our accounts in Outlook, Activate MS Office or access any of the Microsoft 365 web-based apps/services, we would get the Microsoft login screen and when we enter our username/email it would redirect us to our Organization's SSO portal to sign-in and then back to app where we complete the MFA.

How can we implement CDO in this scenario. If there is no way to do this, what would be the alternatives for sending email via VBA Automation?

Share asked Mar 7 at 13:55 psycoperlpsycoperl 1503 silver badges17 bronze badges
Add a comment  | 

2 Answers 2

Reset to default 1

You cannot use CDO 1.21 (I assume that is what you mean by CDO) - it is an Extended MAPI wrapper, and if there is no Extended MAPi system, you cannot use CDO 1.21 even if you could install it (which you cannot).

The the client side, the only way do anything with the new Outlook is a JS addin. Otherwise you need to use Graph.

This does require a specific configuration of the SMTP settings for Outlook/Exhange.

FMS has a lengthy article discussing the details:

SMTP Relay Configuration to Send Emails from Total Access Emailer with Office 365

also holding a link to how to set up a connector:

How to Setup SMTP Relay for IP Addresses in Office 365

But have in mind, that using SMTP is no longer promoted by neither Microsoft nor Gmail. Use their APIs instead which, however, is not the simplest to program in VBA.

We have chosen to use a dedicated e-mail service, the French Mailjet who even offers a free tier. We use their excellent API, but an SMTP relay is also available.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744925731a4601423.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信