关于imap_open函数

问题描述

请在连接失败时隐藏IMAP错误。使用正确的ID时,一切正常。所以有这个:

 $user = $data['email'];
 $pass = $data['pass'];

 $authhost="{imap.ionos.fr:143}";
 $mBox = @imap_open( $authhost,$user,$pass,OP_HALFOPEN,1);
 try{
     if ($mBox){
         echo "<h1>Connected</h1>\n";
         redirect('menu/index');
         imap_close($mBox);
     } else{
         echo '<div class="alert alert-danger mt-1" style="font-size: 14px; text-align: center ;">';
         echo "<h1>FAIL!</h1>\n";   //message d'erreur
         echo 'Login ou mot de passe incorrect ! ';
         echo '</div>';
         $erreur = 'Mauvais login ou mot de passe ! ';
         $this->load->view('user',$erreur);
    }
}
catch(\CodeIgniter\UnkNownFileException $e){
   throw new \RuntimeException($e->getMessage(),$e->getCode(),$e);
}

当我使用错误的ID时,会遇到这个问题:

Severity: Notice

Message: UnkNown: authentication Failed (errflg=1)

Filename: UnkNown

Line Number: 0

Backtrace:

And 

Severity: Notice

Message: UnkNown: Too many login failures (errflg=2)

Filename: UnkNown

Line Number: 0

Backtrace:

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)