Posted on: 11/08/05 09:51am
By: LWC
Posted on: 12/18/05 07:01pm
By: LWC
// This is the return address for all email sent by Geeklog: $_CONF['site_mail'] = 'noreply@mydomain.com'; // This is the target address for notifications sent by Geeklog: // (could be either a uid or a username) // $_CONF['default_contact'] = 2;
COM_mail ($_CONF['site_mail'], $mailsubject, $mailbody);
notification($mailsubject, $mailbody);
function notification($mailsubject, $mailbody) { global $_CONF, $_TABLES; $result = -1; if (isset($_CONF['default_contact'])) { if (is_numeric($_CONF['default_contact'])) $default_type = 'uid'; else $default_type = 'username'; $result = DB_query("SELECT username,fullname,email FROM {$_TABLES['users']} WHERE $default_type = {$_CONF['default_contact']}"); } if ($result) { $A = DB_fetchArray($result); if (!empty ($A['fullname'])) { $to = COM_formatEmailAddress ($A['fullname'], $A['email']); } else { $to = COM_formatEmailAddress ($A['username'], $A['email']); } COM_mail ($to, $mailsubject, $mailbody); } else COM_mail ($_CONF['site_mail'], $mailsubject, $mailbody); }