gpt4 book ai didi

php - 无法在 PHP 中消除 imap_open 错误通知

转载 作者:可可西里 更新时间:2023-11-01 12:43:20 24 4
gpt4 key购买 nike

我正在使用 PHP 5.3.5 我正在使用

$this->marubox=@imap_open($this->server,$this->username,$this->password);

@ 符号应该消除错误报告,但它没有,我确信错误发生在这一行。我希望我的应用程序能够识别问题本身并使用react并且不会收到 NOTICE 错误,并且由于我公司的开发政策,我无法关闭整个 PHP 的错误报告。

没有@我得到:

imap_open() [function.imap-open]: Couldn't open stream {pop3.seznam.cz:110/pop3}INBOX With it i get: Notice Unknown: Authentication failed (Authentication failed) (errflg=1)

如果登录信息正确,它会打开连接并且不会发生错误。

当 imap_open 无法连接并且弄乱了我的 JSON 结果时,我总是会收到 NOTICE 错误。请问如何让它静音?

最佳答案

我加了

$this->marubox=@imap_open($this->server,$this->username,$this->password);
imap_errors();
imap_alerts();

imap_errors();imap_alerts(); 施展魔法 :)

关于php - 无法在 PHP 中消除 imap_open 错误通知,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5422405/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com