Search code examples
phpemailpear

Pear Mail Queue - logs/records?


I am using Pear Mailer and the Mail Queue to send emails. Is it possible to keep the record of each mail in the mail_queue table rather than it being deleted as soon as it is sent?

It would be useful to track the mail for debugging.

Many thanks,

Chris


Solution

  • Read the section "Utilising Callbacks for Report Generation" on http://pear.php.net/manual/en/package.mail.mail-queue.mail-queue.tutorial.php.
    All you have to do is (copy it and) implement the function insert_to_log to write the data in a separate log table.