关于发送批量电子邮件中的成功传送报告的问题 [英] Question about Unsuccessful delivery reports in sending bulk Emails

查看:179
本文介绍了关于发送批量电子邮件中的成功传送报告的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有大约10k个用户订阅新闻的数据库。我正在将我的网站从asp更改为php。我通过cron工作发送通讯。我想跟踪不成功的交货报告记录。这怎么可能?
请指导我,谢谢。

解决方案



函数,您应该使用
条件检查

if(mail($ to,$ subject,$ message,
$ headers)) {// Successfull mail
delivery} else {// Code for
un-successfull mailing}


对于OP实际尝试做的操作是非常不精确的... 从手册


重要的是要注意,只要
,因为邮件被接受为
传递,它不意味着邮件
将实际达到预期的
目的地。


根据服务器类型和配置,您将获得变化的结果。更好地使用SMTP来确保正确和一致的界面。一般来说,我会使用一个库来做这个...你可以手动使用套接字,但为什么要重新发明轮?根据项目,我使用3个库。





对于这种交互级别,我将使用SwiftMailer或Zend_Mail。这两个都支持从SMTP获取信息以及发送消息,所以例如您可以获取有关失败的收件人的信息( SwittleMailer示例)。 Zend和Swift都支持自定义线轴队列,因此您可以更深入地集成以应用程序感知的方式排队和发送消息。 SwiftMailer也有批量发送功能...我认为这在Zend_Mail中也是可用的,但是从来没有挖过来。



这只是战斗的一半为了实际读取NDR,您需要脚本登录到邮件存储区,循环访问邮件,然后再将解析NDR的头文件和/或消息体(请确保您参考wikipage上列出的RFC文档),然后根据这些操作。最近我使用 Zend_Mail_Storage 来处理这个问题。如果您需要这样做,那么您可能还想继续使用Zend_Mail发送,因为存储包含在组件中。你需要看看NDR和状态代码的RFC,以便正确解析。



总的来说,如果可能的话,我建议只要整合一个第三方服务,如 MailChimp 常规联系人。它的工作量少得多,除非你有一个开发团队在这个时间上工作,否则服务可能会在整体上产生更好的结果。


I have database of approximately 10k users who have subscribed for newsletters. I am changing my site from asp to php. I am sending newsletters by cron job. I want to track the record of unsuccessful delivery report. How is it possible? Please Guide me, Thanks.

解决方案

In php when you sending mail with mail function you should check with condition

if(mail($to, $subject, $message, $headers)){ // Successfull mail delivery } else { // Code for un-successfull mailing }

This is highly inaccruate for what the OP is actually trying to do... From the manual:

It is important to note that just because the mail was accepted for delivery, it does NOT mean the mail will actually reach the intended destination.

Depending on server type and configuration you will get varying results. Its better to use SMTP to ensure a proper and consistent interface. Generally i would use a library to do this... you could do it yourself manually using sockets, but why reinvent the wheel? There are 3 libraries i use depending on the project...

For this level of interaction i would use SwiftMailer or Zend_Mail. Both of these support getting information from SMTP as well as sending the message, so for example you can get info about failed recipients (SwitftMailer example). Both Zend and Swift also support custom spools queues so you can more deeply integrate queuing and sending messages in an application aware way. SwiftMailer also has batchSend functionality... i assume this is available in Zend_Mail as well but ive never dug in to deep.

This is only half the battle though... In order to actually read the NDR's you need to script logging in to the mail store, looping through the messages, and then parsing the headers and/or the message body of the NDR (make sure you refer to the RFC docs listed on the wikipage), then take action based on that. Recently i used Zend_Mail_Storage to handle this. If you need to do this then you probably also want to just go ahead and use Zend_Mail for sending as well since Storage is included in the component. Youll need to take a look at the RFC for NDR's and status codes in order to parse properly.

Overall, if at all possible, i recommend just integrating a 3rd party service like MailChimp or Constant Contact. Its a a lot less work, and unless you have a team of devs working on this over time a service is probably going to yield better results across the board.

这篇关于关于发送批量电子邮件中的成功传送报告的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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