跟踪退回的新闻通讯电子邮件
我已经构建了一个时事通讯系统,用于跟踪:
- 空缺
- 链接点击
- 取消订阅
但是,我需要找到一种方法来跟踪哪些时事通讯电子邮件“退回”。
以前有人这样做过吗?最好的方法是什么?
I've built a newsletter system which tracks:
- Openings
- Link clicks
- Unsubscriptions
However, I need to find a way of tracking which newsletter emails 'bounced back'.
Has anyone done this before and whats the best way of doing it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
通过 SMTP 发送邮件时,您需要提供 FROM 命令,该命令有时称为“发件人”或“信封发件人”。这与电子邮件本身的“发件人:”标头是分开的。您想要做的是创建一个“退回”邮箱并将其设置为电子邮件的“发件人”。如果出现退回邮件,大多数邮件服务器都会向该发件人发送回 (NDR) 通知。
然后,您需要定期检查此邮箱中的 NDR,并解析它们以查找原始收件人以及是否是硬退回邮件或软退回邮件。有各种库可以为您执行此操作,例如 ListNanny
When sending the mail via SMTP you supply the FROM command which is sometimes referred to as the 'Sender' or 'Envelope Sender'. This is separate from the From: header in the email itself. What you want to do is to create a 'bounced' mailbox and set that as the 'Sender' for the email. If there is a bounce, then most mail servers will send a (NDR) notification back to this sender.
Then you need to periodically check this mailbox for NDR's and parse them for the original recipient and if it was a hard or soft bounce. There are various libraries that can do this for you such as ListNanny