如何禁用PHPMailer中的错误消息? [英] How to disable error messages in PHPMailer?

查看:57
本文介绍了如何禁用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."

谢谢

推荐答案

这可能不是最好的解决方案,但它可以工作.

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆