禁用PHPMailer错误消息 [英] Disable PHPMailer error messages
本文介绍了禁用PHPMailer错误消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何禁用PHPMailer类的错误消息?我显示我自己的错误消息,我不希望用户看到错误,如SMTP错误:无法连接到SMTP主机。
How do I disable the error messages from the PHPMailer class? I'm displaying my own error messages and I don't want users to see errors such as "SMTP Error: Could not connect to SMTP host."
我的代码: http://pastie.org/1497819
谢谢
推荐答案
这不是最好的解决方案,但它的工作原理。
This is not probably the best solution, but it works.
在您的phpmailer库文件夹中打开class.phpmailer.php,
In your phpmailer library folder open "class.phpmailer.php",
查找
public function Send()
里面注释行
echo $e->getMessage()."\n";
这篇关于禁用PHPMailer错误消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文