I'm having problems catching the error for the email webklex imap. i want to check if connected or not connected. credentials are correct, i only need to catch if the credentials are wrong or not connected.
Thanks.
$oClient = new Client([
'host' => 'imap.gmail.com',
'port' => $account_type['port'],
'encryption' => 'ssl',
'validate_cert' => true,
'username' => $username,
'password' => $password,
'protocol' => 'imap'
]);
$oClient->connect();
if(){
//check if connected or not
}