简体   繁体   English

通过PHP发送的邮件能否获得Exim的msgid?

[英]Is it possible to get Exim's msgid for a mail sent through PHP?

I'm sending emails with PHPMailer and saving the mail details to a database. 我正在使用PHPMailer发送电子邮件,并将邮件详细信息保存到数据库中。 I would like to use Exim stats' logs to see if there was a problem with delivery. 我想使用Exim统计信息的日志来查看投放是否存在问题。 Exim stats has a mysql database containing logs of all the outgoing mails sent through SMTP, but I need the message id (msgid) to connect the log entries to my email table. Exim stats有一个mysql数据库,其中包含通过SMTP发送的所有外发邮件的日志,但是我需要消息ID(msgid)才能将日志条目连接到我的电子邮件表。

Any ideas? 有任何想法吗? Can I get the mailid after I sent the mail / or set it by hand before sending? 发送邮件后,是否可以获取mailid?或者在发送之前手动进行设置?

I'm sending emails with PHPMailer and saving the mail details to a database. 我正在使用PHPMailer发送电子邮件,并将邮件详细信息保存到数据库中。 I would like to use Exim stats' logs to see if there was a problem with delivery. 我想使用Exim统计信息的日志来查看投放是否存在问题。 Exim stats has a mysql database containing logs of all the outgoing mails sent through SMTP, but I need the message id (msgid) to connect the log entries to my email table. Exim stats有一个mysql数据库,其中包含通过SMTP发送的所有外发邮件的日志,但是我需要消息ID(msgid)才能将日志条目连接到我的电子邮件表。

It all depends on how you send your e-mail; 这完全取决于您如何发送电子邮件。 I don't think it's possible to do so with PHP's native mail ( ) function, but you might be able to do it with a more sophisticated library such as SwiftMailer . 我认为无法使用PHP的本机mail ()函数来实现此目的,但您可以使用更复杂的库(例如SwiftMailer)来实现 SwiftMailer does provide a getId( ) method, which seems to do what you want. SwiftMailer确实提供了getId()方法,该方法似乎可以满足您的要求。

Also, when you use Swift's SMTP transport, you can see what is happing in the SMTP session; 另外,当您使用Swift的SMTP传输时,您可以看到SMTP会话中正在隐藏的内容。 if it fails in the session itself, this is visible. 如果会话本身失败,则可见。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM