跟踪通过PHP发送的SMTP邮件

编程入门 行业动态 更新时间:2024-10-24 13:26:18
本文介绍了跟踪通过PHP发送的SMTP邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在开发一个小邮件发件人门户,允许注册用户发送一些电子邮件。我使用安装在本地主机上的SMTP服务器(我的意思是Apache和PHP的同一服务器)的安全连接发送电子邮件,并且我已经实施了一个系统来控制发送的电子邮件数量(我安排发送电子邮件到避免在同一时间发送太多的电子邮件。)

I'm developing a little email sender portal that allows registered users to send some amounts of emails. I use a secure connection with an SMTP server installed on localhost (I mean same server of Apache and PHP) to send the emails and I have implemented a system to take control on the amounts of emails sent (I schedule the sending of the emails to avoid sending too much emails at the same time).

我使用PHPMAiler类发送电子邮件和一个我自己的类来安排他们。

I use PHPMAiler class to send the emails and a class of my own to schedule them.

我唯一想念的是跟踪我发送的电子邮件,了解是否发生了一些错误(特别是哪个错误,即找不到地址,收件人邮箱已满等)并知道用户是否打开了电子邮件以及何时。

The only thing I miss is to track the emails I've sent to know if some errors occured (and which error in particular ie. address not found, recipient mailbox full, etc...) and to know if the user opened the email and when.

我承认我几乎完全不了解SMTP服务器,但我想知道是否有一些资源,我可以找到一个PHP类,可以与SMTP服务器通话以询问发送的电子邮件,或者如果PHP中有任何方式来检索发送的电子邮件信息....或任何其他可能对我的用途有用的东西。

I admit that I actually know almost nothing about SMTP servers, but I'd like to know if there are some resources where I can find a PHP class that can talk to the SMTP server to ask it for the sent emails, or if there's any way in PHP to retreive sent emails information.... or anything else that could be useful for my purposes.

推荐答案

没有办法跟踪电子邮件一旦离开,但你有两个选择。一个是检查退回的消息。通常,外发邮件将指定一个返回路径,弹跳将转到。

There is no way to track the email once it leaves however you do have two options. One is to check for bounced messages. Normally outgoing messages will specify a return-path that the bounces will go to.

另一个选项是您可以控制发送服务器。如果您要发送的服务器是服务器,例如抱怨用户丢失,那么您将收到一个SMTP错误代码。 SMTP错误代码几乎与HTTP的错误代码相反,因为500是硬反弹(永久性错误,如用户在此不知道)和400的软弹跳(临时错误)。

The other option is that you do have control of the sending server. If the server that you are sending to is the server that complains that the user is missing for example then you will receive one of the SMTP error codes. SMTP error codes are pretty much the oposite to HTTP ones in that 500's are hard bounces (permanent errors like user is not known here) and 400's soft bounces (temporary errors).

最后还可以添加一个小图像(将通过您的php脚本渲染)来跟踪电子邮件的打开,显然这将无法帮助用户阻止图像,但它可以提供用户已读取的一些想法电子邮件(以及链接跟踪)

Finally it is also possible to add a small image (that will render via your php script) to track opens of an email, obviously this won't help if the user blocks the images but it can provide some idea that the user has read the emails (along with link tracking)

更多推荐

跟踪通过PHP发送的SMTP邮件

本文发布于:2023-10-13 00:14:01,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1486272.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:邮件   PHP   SMTP

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!