简体   繁体   中英

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. I would like to use Exim stats' logs to see if there was a problem with delivery. 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.

Any ideas? Can I get the mailid after I sent the mail / or set it by hand before sending?

I'm sending emails with PHPMailer and saving the mail details to a database. I would like to use Exim stats' logs to see if there was a problem with delivery. 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.

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 . SwiftMailer does provide a getId( ) method, which seems to do what you want.

Also, when you use Swift's SMTP transport, you can see what is happing in the SMTP session; if it fails in the session itself, this is visible.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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