Page 1 of 1

[MOD] Copy all outgoing emails to address (for debug)

Posted: Wed Jun 02, 2010 3:12 pm
by Martin
In response to this query:
rjcuser wrote:Is there a way of getting copies of messages sent in and out, sent out as an email for other users to monitor the messaging?
To copy the messages received you'd need to setup a forwarder on your hosting account (talk to your host)

To copy messages that the system sends you can do that with a simple edit:

Open: lib/email.php

Find:

Code: Select all

        $headers .= 'From: ';
        if ($this->FromName) {
            $headers .= '"' . $this->_utf8_encode($this->FromName) . '" ';
        }

        $headers .= '<' . $this->FromAddress . '>' . $this->_newline;
After, Add:

Code: Select all

        // Copy all email traffic to admin
        $headers .= 'bcc: debug@foo.com' . $this->_newline;
Obviously you need to put the correct email address in there in place of debug@foo.com but it works nicely..

Bear in mind you will be getting login details as well as everything else so you should ensure the account is secure and that you regularly purge it to avoid someone using the details to login and steal from your customers by logging orders against them.