有没有办法知道为什么php邮件函数返回false(它发生'有时') [英] is there a way to know why php mail function returns false (it happens 'sometimes')

查看:202
本文介绍了有没有办法知道为什么php邮件函数返回false(它发生'有时')的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在调用php函数邮件,但是它返回 false 约5% - 10%的时间,这让我疯狂了。



我想从php端,一切都配置得很好,因为(如果我错了,请纠正我)如果不是这个功能每一次都会失败。


$ b $所以问题是我怎么知道这个行为的原因?我可以做些什么来调试这个?

解决方案

我不喜欢PHP中的 code>因此。但是我的失败率低于1%。



我建议使用 PEAR :: Mail ,如 article <一>。它使用smtp服务器发送电子邮件。如果发生错误,您将收到一条真正的错误消息。


I'm calling php function mail, but it's returning false about 5% - 10% of the times, and it's driving me crazy.

I guess from the php side everything is well configured because (correct me if i'm wrong) if not the function should fail every single time.

So the question is how can i know the reason of this behavior? What can i do to debug this?

解决方案

I don't like PHP's build in mail for that reason. But my failure rate was below 1%.

I suggest using PEAR::Mail as described in this article. It uses an smtp-server to send emails. If an error occurs, you'll get a real error message.

这篇关于有没有办法知道为什么php邮件函数返回false(它发生'有时')的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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