Reputation: 31
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
}
Upvotes: 2
Views: 1212
Reputation: 911
Use $oClient->isConnected();
or $oClient->checkConnection();
It really depends on your requirement.
For more information follow the documentation: https://github.com/Webklex/laravel-imap#clientclass
Upvotes: 0