Php 如何将发送一封电子邮件的整个SMTP成绩单存储到数据库?

Php 如何将发送一封电子邮件的整个SMTP成绩单存储到数据库?,php,symfony,email,smtp,postfix-mta,Php,Symfony,Email,Smtp,Postfix Mta,我的Symfony应用程序将登录用户的电子邮件发送到另一家公司 user -> mypage -> email -> companyX 通常我只使用swiftmailer发送电子邮件,但在这种情况下,我需要将发送te电子邮件的整个SMTP副本存储到数据库(每封电子邮件)以供确认 我还没有找到直接从swiftmailer或任何其他php邮件库获取此信息的方法。某处有这样的图书馆吗 我的方法是使用mta(后缀)的日志,以某种方式解析信息,并通过cronjob将其存储到数据库中 有

我的Symfony应用程序将登录用户的电子邮件发送到另一家公司

user -> mypage -> email -> companyX
通常我只使用swiftmailer发送电子邮件,但在这种情况下,我需要将发送te电子邮件的整个SMTP副本存储到数据库(每封电子邮件)以供确认

我还没有找到直接从swiftmailer或任何其他php邮件库获取此信息的方法。某处有这样的图书馆吗

我的方法是使用mta(后缀)的日志,以某种方式解析信息,并通过cronjob将其存储到数据库中

有没有更简单/更好的方法

这是这样一个例子:

telnet www.sample.com 25

Server Response: 220 www.sample.com ESMTP Postfix
Client Sending : HELO domain.com
Server Response: 250 Hello domain.com
Client Sending : MAIL FROM: <me@domain.com>
Server Response: 250 Ok
Client Sending : RCPT TO: <friend@sample.com>
Server Response: 250 Ok
Client Sending : DATA
Server Response: 354 End data with <CR><LF>.<CR><LF>
Client Sending : Subject: Example Message
Client Sending : From: me@domain.com
Client Sending : To: you@sample.com
Client Sending :
Client Sending : Yo,
Client Sending :
Client Sending :   Sending a test message.
Client Sending :
Client Sending :   Later,
Client Sending : Carl
Client Sending : .
Server Response: 250 Ok: queued as 45334
Client Sending : QUIT
Server Response: 221 Bye
telnet www.sample.com 25
服务器响应:220 www.sample.com ESMTP Postfix
客户端发送:HELO domain.com
服务器响应:250 Hello domain.com
客户端发送:邮件发件人:
服务器响应:250正常
客户端发送:RCPT到:
服务器响应:250正常
客户端发送:数据
服务器响应:354结束数据与。
客户端发送:主题:示例消息
客户端发送:从:me@domain.com
客户端发送:发送到:you@sample.com
客户端发送:
客户发送:哟,
客户端发送:
客户端发送:发送测试消息。
客户端发送:
客户端发送:稍后,
客户发送:Carl
客户端正在发送:。
服务器响应:250正常:排队为45334
客户端发送:退出
服务器响应:221再见

您必须使用邮件服务器日志。您必须使用邮件服务器日志。