Outbound Email Not working

I am trying to setup Outbound email but I keep getting the following issue:

1: SMTP ERROR: Password command failed: 535 5.7.3 Authentication unsuccessful [MN2PR19CA0035.namprd19.prod.outlook.com]

  • SuiteCRM version 7.11.6
  • SMTP ServerName: smtp.office365.com
  • Port 587
  • SMTP Auth: Checked
  • SMTP Protocol TLS
  • The username is the full email address of a user and the O365 password associated with it.
  • Multiple users have been tried and passwords have been checked many times.
  • The user in O365 has Authenticated SMTP allowed.
3: Connection: opening to smtp.office365.com:587, timeout=300, options=array()
3: Connection: opened
2: SERVER -> CLIENT: 220 MN2PR19CA0035.outlook.office365.com Microsoft ESMTP MAIL Service ready at Wed, 20 Nov 2019 14:49:28 +0000

1: CLIENT -> SERVER: EHLO XXXXX

2: SERVER -> CLIENT: 250-MN2PR19CA0035.outlook.office365.com Hello [2a02:4780:1:8::10]
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 XXXX

2: SERVER -> CLIENT: 250-MN2PR19CA0035.outlook.office365.com Hello [2a02:4780:1:8::10]
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.3 Authentication unsuccessful [MN2PR19CA0035.namprd19.prod.outlook.com]

1: SMTP ERROR: Password command failed: 535 5.7.3 Authentication unsuccessful [MN2PR19CA0035.namprd19.prod.outlook.com]

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

2: SERVER -> CLIENT: 221 2.0.0 Service closing transmission channel

3: Connection: closed
3: SMTP Error: Could not authenticate.

This has to be some sort of O365 thing as I am able to setup other mail severs without issue.
I can’t setup IMAP either. It gives me the same sort of issue. Username or Password is incorrect. I assure you they are not incorrect.

Could it be from PHP Mailer used in SuiteCRM?

https://github.com/PHPMailer/PHPMailer/issues/1339

Thank you for the advice but I already upgraded:

SMTP.php, PHPMailer.php, Exception.php, OAuth.php, and SugarPHPMailer.php

Still not functioning.

SuiteCRM supports OAuth for inbound email only.
This is due to an update within the last year.
I don’t know why there isn’t support for SMTP yet.

That being said, it is possible to create app passwords

I don’t know if the issue you’re having is the same as mine, but when I setup the outbound SMTP connection and “Send Test Email” it works just fine. When I save and edit again (or just try and use the email account) it cannot authenticate. I suspect it’s not saving the password correctly (or retrieving it correctly).

I checked in the database and there is an encrypted password saved. I tried entering the password directly in the DB as MD5 encryption. That didn’t seem to help.

There is a bug reported on Github:

There is a fix reported here:

I’ll try it out and report back!

Ok I can confirm the above fixes the problem. You can test, save and then re-send email. Email also works from email compose after this fix.

SuiteCRM Version 7.13
Have this Erro
3: Connection: opening to smtp.office365.com:587, timeout=300, options=array()
3: Connection: opened
2: SERVER → CLIENT: 220 SI2PR04CA0005.outlook.office365.com Microsoft ESMTP MAIL Service ready at Thu, 28 Sep 2023 12:41:33 +0000

1: CLIENT → SERVER: EHLO demmo.live.aurocrm.com

2: SERVER → CLIENT: 250-SI2PR04CA0005.outlook.office365.com Hello [52.187.172.152]
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 demmo.live.aurocrm.com

2: SERVER → CLIENT: 250-SI2PR04CA0005.outlook.office365.com Hello [52.187.172.152]
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, SmtpClientAuthentication is disabled for the Tenant. Visit Enable or disable SMTP AUTH in Exchange Online | Microsoft Learn for more information. [SI2PR04CA0005.apcprd04.prod.outlook.com 2023-09-28T12:41:40.597Z 08DBBE99E97BC6B7]

1: SMTP ERROR: Password command failed: 535 5.7.139 Authentication unsuccessful, SmtpClientAuthentication is disabled for the Tenant. Visit Enable or disable SMTP AUTH in Exchange Online | Microsoft Learn for more information. [SI2PR04CA0005.apcprd04.prod.outlook.com 2023-09-28T12:41:40.597Z 08DBBE99E97BC6B7]

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

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

3: Connection: closed
3: SMTP Error: Could not authenticate.
When try to configure outbound email for office365
Using
Server : smtp.office365.com
TLS
587
Use SMTP Authentication?: yes
But not working
Anyone please help

@abhi123 please don’t double-post (or triple-post), and don’t hijack old threads.

The best way to get help is to start your own thread and put in all the details.