获取邮件应用程序来识别回复电子邮件 php
我不知道如何让邮件应用程序(谷歌邮件除外)识别电子邮件是作为“回复”发送的,并将这些电子邮件分组在一起作为已发送和回复电子邮件的列表。
例如,使用php,如果我使用
$header = "From: Testing <[email protected]>\r\n" .
"Reply-To: [email protected]\r\n" .
"X-Mailer: PHP/" . phpversion();
$to = "[email protected]";
$message = "This is a reply";
$subject = "test 123";
$success = mail($to, $subject, $message, $header);
发送两次,我收到两封单独的电子邮件。而不是由两封电子邮件组成一封电子邮件。
有没有办法将它们组合在一起,当一封电子邮件回复另一封电子邮件时,或者我做错了什么?
我已经阅读了 php mail() 文档和多个解释 php mail 如何工作的网页,但仍然无法让电子邮件相互回复。
感谢您的时间和帮助!
I can't figure out how to get a mail application (except google mail) to recognize that an email was sent as a "Reply-To" and have those emails grouped together as one list of sent and replied emails.
For example, using php, if I use
$header = "From: Testing <[email protected]>\r\n" .
"Reply-To: [email protected]\r\n" .
"X-Mailer: PHP/" . phpversion();
$to = "[email protected]";
$message = "This is a reply";
$subject = "test 123";
$success = mail($to, $subject, $message, $header);
And send this twice, I get two separate emails. Instead of one email composed of the two emails.
Is there a way to have them both grouped together as one email replied to another, or am I doing something wrong?
I've read the php mail() documentation and multiple webpages explaining how php mail works and still can't get the emails to reply to each other.
Thank you for your time and help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
回复标头用于指示应将回复发送到与发件人标头中的电子邮件地址不同的电子邮件地址。
我认为如果消息正文的一部分包含以前发送或回复消息的一部分的文本,或者主题包含 Re: 并与另一组消息中的主题匹配,Google 会采用一种算法将消息分组在一起。但回复标头可能对将消息分组为回复没有影响。
The reply-to header is used to indicate a reply should be sent to a different email address than the one in the from header.
I think Google employs an algorithm to group messages together if part of the message body contains text that was part of a previously sent or replied to message, or if the subject contains Re: and matches a subject from another group of messages. But the reply-to header probably has no effect on grouping messages as a reply.
我看这里没有问题。发送两封电子邮件导致收到两封电子邮件。这是预期的行为。 GMail 将它们分组在 UI 中的一个线程中,但在幕后,甚至 GMail 也将它们视为两个单独的消息。这完全独立于 Reply-To 标头。
I see no problem here. Two emails sent results in two emails received. This is the expected behavior. GMail is grouping them together in a thread in the UI, but under the hood, even GMail treats these as two separate messages. This is all totally independent of the
Reply-To
header.大多数邮件客户端通过检查
Message-ID
、In-Reply-To
和References
标头来处理线程。在第一条消息中,设置Message-ID
标头,然后使用与References
和In-Reply-To
标头相同的值。邮件客户端应通过定位原始Message-ID
并将其与具有相关References
和In-Reply-To
标头的消息进行匹配来对它们进行分组。第一条消息:
第二条消息:
Most mail clients handle threading by examining the
Message-ID
,In-Reply-To
, and theReferences
headers. In your first message, set aMessage-ID
header, then use the same value as theReferences
andIn-Reply-To
headers. The mail clients should group them by placing locating the originalMessage-ID
and matching it with messages having relatedReferences
andIn-Reply-To
headers.First message:
Second message: