imap_open in php suddenly stopped working reading office 365 mail box from 15 Oct 2022. Talked to a Vendor of Office 365. He adviced to use TLS 1.2. But I have no idea how to use TLS 1.2 in my code.
How to incorporate TLS 1.2 in the code? The error I am getting is as below:
Can not authenticate to IMAP server: AUTHENTICATE failed.
$username = $row->email;
$password = $row->password;
$mailbox = "{outlook.office365.com:993/imap/ssl/authuser=$username}";
$inbox = imap_open($mailbox, $username, $password);
if (!$inbox){
print imap_last_error();
}