使用Codeigniter的邮件库检测电子邮件传递错误 [英] Detect email delivery error with Codeigniter's mail library

查看:115
本文介绍了使用Codeigniter的邮件库检测电子邮件传递错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可以使用 $ this-> email-> send()有条件地使用和 $ this-> email-> print_debugger()?像这样...

Is it possible to catch delivery error with $this->email->send() used conditionally and $this->email->print_debugger()? Like this...

if (!$this->email->send()){
  // Error
  $this->email->print_debugger()
}else{
  // Success
}

在我的情况下,如果收件人是一个假电子邮件地址, send()函数总是返回true。邮件协议设置为标准的php邮件功能,我需要设置配置协议为smtp?

In my case if the recipient is a fake email address the send() function always return true. Mail protocol is set to standard php mail function, do i need to set config protocol to smtp?

或者我要问一些必须使用单独的过程(例如管道反弹到服务器dir的消息,并稍后解析它)?

Or am I asking something that must be done with a separate procedure (such as pipe bounce messages to a server dir and parse it later)?

推荐答案

CI电子邮件库不知道收件人是否合法。

The CI Email library doesn't know whether the recipient is legit or not. Nor will any other library.

只有有限的确定性,您才能知道何时尝试发送邮件。

You can only know with a limited certainty when the mail is trying to be sent.

您的系统邮件日志可以告诉一些,退信可能告诉一些其他的,但你永远不会确定,即使邮件是发送,不会被弹回。

Your system mail log can tell some, bounces might tell some of the others but you will never know for sure even if the mail is sent and doesn't gets bounced. You'd might be sending to a spamtrap, catchall or something third.

如果您正在进行定期发送,您应该强制收件人验证其邮件地址。

You should force recipients to validate their mail address, if you are doing recurring sends.

这篇关于使用Codeigniter的邮件库检测电子邮件传递错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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