SugarPHPMailer encountered an error: SMTP Error

hello everyone, as per subject, I have a problem with email via suitecrm.
When I am in “outgoing email accounts” and I try to send a test email, I get this error:
SMTP Error: Could not authenticate,
but if I do “change password” there are no errors.
Going to SugarPHPMailer.php and uncommenting the line:
$ GLOBALS ['log'] -> debug ("PHPMailer Send Function: {FromName: $ this-> FromName From: $ this-> From Host: $ this-> Host UserName: $ this-> Username Password: $ this- > Password} ");

If I don’t “change password”, the correct username is taken but the password is that of System.
If I “change password” username and password are correct.

It is important, can you please tell me how to solve the problem? Thanks in advance.

SMTP server name: smtp.office365.com
SMTP protocol: TLS
SuiteCRM version: 7.10.20 Sugar Version 6.5.25 (Version 344)

I think this is already fixed in the latest version…

I have checked the bugs fixed in the following versions, up to the last one released, but this specific problem does not appear.
Any way to resolve without waiting for resolution from the released version?

It’s very hard to be sure, just form the release notes… the only certain way to know this is to run a test in the latest version.

You can try it here, this live demo allows admin access:

https://www.softaculous.com/demos/SuiteCRM