Sending Email with Microsoft OAuth Connection Setup

Morning

So I have successfully got my Inbox showing from my company Outlook Emails configuring the Oauth connector etc .
I am now trying to send an email and need to configure the SMTP . PLease can someone help as this does not seem to use the same OAuth connection ?
Thanks

Jon

No currently only the inbound email uses OAuth setup.
The outbound Email is same smtp authentication

So what SMTP details would I need to send from my office365 email address

Im getting closer but getting this now any ideas ?

3: Connection: opening to outlook.office365.com:587, timeout=300, options=array()
3: Connection: opened
2: SERVER → CLIENT: 220 LO4P265CA0288.outlook.office365.com Microsoft ESMTP MAIL Service ready at Mon, 7 Aug 2023 13:41:40 +0000

1: CLIENT → SERVER: EHLO impactmetering.com

2: SERVER → CLIENT: 250-LO4P265CA0288.outlook.office365.com Hello [185.181.117.205]
250-SIZE 157286400
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-STARTTLS
250-8BITMIME
250-BINARYMIME
250-CHUNKING
250 SMTPUTF8

1: CLIENT → SERVER: STARTTLS

2: SERVER → CLIENT: 220 2.0.0 SMTP server ready

1: CLIENT → SERVER: EHLO impactmetering.com

2: SERVER → CLIENT: 250-LO4P265CA0288.outlook.office365.com Hello [185.181.117.205]
250-SIZE 157286400
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-AUTH LOGIN XOAUTH2
250-8BITMIME
250-BINARYMIME
250-CHUNKING
250 SMTPUTF8

1: CLIENT → SERVER: AUTH LOGIN

2: SERVER → CLIENT: 334 VXNlcm5hbWU6

1: CLIENT → SERVER: —obfuscated—
2: SERVER → CLIENT: 334 UGFzc3dvcmQ6

1: CLIENT → SERVER: —obfuscated—
2: SERVER → CLIENT: 535 5.7.139 Authentication unsuccessful, the request did not meet the criteria to be authenticated successfully. Contact your administrator. [LO4P265CA0288.GBRP265.PROD.OUTLOOK.COM 2023-08-07T13:41:49.272Z 08DB971A10284862]

1: SMTP ERROR: Password command failed: 535 5.7.139 Authentication unsuccessful, the request did not meet the criteria to be authenticated successfully. Contact your administrator. [LO4P265CA0288.GBRP265.PROD.OUTLOOK.COM 2023-08-07T13:41:49.272Z 08DB971A10284862]

3: SMTP Error: Could not authenticate.
1: CLIENT → SERVER: QUIT

2: SERVER → CLIENT: 221 2.0.0 Service closing transmission channel

3: Connection: closed

You have to create an app password in Office 365 to avoid 2 factor login. I’ve successfully done it using an app password.

If you just try and user your O365 password it will fail every time because of 2 factor.

(I spent like 2 days trying to figure it out! That’s two days I’ll never get back!).

Yea I have done that, and trying to use it. think issue is with MS>

There is also a bug where SuiteCRM does not save the password correctly on SMTP settings. (that was another two day’s I’ll never get back!)…

FYI, just ran into this today, you might find SMTP auth is turned off on Azure. It has to be specifically turned on either for the organization or individual mailbox!

https://learn.microsoft.com/en-us/exchange/clients-and-mobile-in-exchange-online/authenticated-client-smtp-submission

Turning on basic auth passwords for Azure is not a solution, it is a bad practice and should be avoided.

The CRM needs to be able to connect to email services using OAuth for authentication.