Hi again Jack,
I managed to use PHPmailer class to send the emails.
For other people using the same contrib (
http://addons.oscommerce.com/info/7226), here is what I changed on admin/includes/functions/sitemonitor_functions.php:
Find:
if ($ttlErrors || $always_email) {
mail($to, 'Site Monitor Results', $msg, $from);
if ($verbose)
echo 'Email sent to shop owner.' .'<br>';
}
Replace by:
if ($ttlErrors || $always_email) {
// include server parameters
require('includes/configure.php');
$server=DB_SERVER; # host name of server running MySQL
$user=DB_SERVER_USERNAME; # existing login username for mysql
$password=DB_SERVER_PASSWORD; # login password for mysql username
$dbname=DB_DATABASE; # name of existing database to use
// Connect to database and get all config values.
$config_values="";
$dbconn=@mysql_connect($server,$user,$password) or http_headers('','Error,Database Connection');
@mysql_select_db($dbname,$dbconn) or http_headers('','Error,Database Connection');
$sql="select configuration_key as cfgKey, configuration_value as cfgValue from configuration where configuration_group_id='12' or configuration_group_id='1'";
$result=@mysql_query($sql,$dbconn) or http_headers('','Error,Database Connection');
while ($row = @mysql_fetch_array($result)) {
if ($row['cfgKey'] != "LAST_HASH") $config_values.=$row['cfgKey'].'='.$row['cfgValue']; // To be fed to hashing function.
define($row['cfgKey'], $row['cfgValue']);
}
if(EMAIL_USE_PHPMAILER == 'true')
{
require(DIR_WS_FUNCTIONS . 'general.php');
require_once(DIR_WS_CLASSES . 'phpmailer/class.phpmailer.php');
tep_mail($to, $to, 'Site Monitor Results' . ' - ' . STORE_NAME, $msg, $from, $from);
}
else {
mail($to, 'Site Monitor Results', $msg, $from);
}
if ($verbose)
echo 'Email sent to shop owner.' .'<br>';
}
I had also the change the $from string in the sitemonitor_configure_0.txt (as for other instances if they exist) from:
$from = 'From: some_address@your_domain.com'; //where email is sent from
to:
$from = 'some_address@your_domain.com'; //where email is sent from
as I got an error saying:
Invalid address: From: some_address@your_domain.com
Of course I changed some_address@your_domain.com to my real email address...
This last change can also be performed on sitemonitor_functions.php for any new configuration files to be created using the right string.
Enjoy!