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

For Articles relating to more than one ISC version
Post Reply
Martin
Site Admin
Site Admin
Posts: 1854
Joined: Wed Jun 17, 2009 6:30 pm
Location: South Yorkshire UK
Contact:

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

Post 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.
Post Reply