dongleiwei2182 2015-10-20 13:27
浏览 67

无法在Zend SMTP中捕获SMTP服务器ping错误

I'm trying to determine the availability of a SMTP server or a valid authentication of a SMTP server while sending mail by Zend\Mail\Transport\Smtp. I can detect that mail is not sent due to server unavailable or server settings wrong or server authentication fail. All code running well and exception is caught properly. But when my script is at end position i.e. when PHP try to destroy connection variable automatically Zend is try to disconnect server and try to destroy that instance. That time server is not UP cause I know the server settings is wrong. While destroying that instance it arise

"Fatal error: Uncaught exception 'Zend\Mail\Protocol\Exception\RuntimeException' with message 'Could not read from XXX.XXX.XXX.XXX'"

I cannot grab that error in any way! I tried set error handler, set exception handler but no luck. Cause its return while destructing. And PHP control that destruction process...

I try by putting try ... catch block in __destroy method but it arise more error.

Any suggestion?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 phython路径名过长报错 不知道什么问题
    • ¥15 深度学习中模型转换该怎么实现
    • ¥15 HLs设计手写数字识别程序编译通不过
    • ¥15 Stata外部命令安装问题求帮助!
    • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
    • ¥15 TYPCE母转母,插入认方向
    • ¥15 如何用python向钉钉机器人发送可以放大的图片?
    • ¥15 matlab(相关搜索:紧聚焦)
    • ¥15 基于51单片机的厨房煤气泄露检测报警系统设计
    • ¥15 Arduino无法同时连接多个hx711模块,如何解决?