2
This won't be a two-minute fix, but here's what I would do:
Make a new module for mail queuing. In this example, I'll put it in a folder called queue and I will be using XOOPS 2.2
The module will have one table, queue_mail, with three fields: mailid, mailheader and mailbody.
It will also have a class file for managing this table:
class MailQueue extends XoopsObject {
function MailQueue() {
$this->initVar('mailid', XOBJ_DTYPE_INT);
$this->initVar('mailheader', XOBJ_DTYPE_OTHER);
$this->initVar('mailbody', XOBJ_DTYPE_OTHER);
}
}
class QueueMailHandler extends XoopsPersistableObjectHandler {
function QueueMailHandler(&$db) {
$this->XoopsPersistableObjectHandler($db, "queue_mail", "MailQueue", "mailid");
}
function insertMail($header, $body) {
$obj = $this->create();
$obj->setVar('mailheader', $header);
$obj->setVar('mailbody', $body);
return $this->insert($obj);
}
}
In /class/mail/xoopsmultimailer.php, make a new method like this:
function Send() {
$header = "";
$body = "";
if((count($this->to) + count($this->cc) + count($this->bcc)) < 1)
{
$this->error_handler("You must provide at least one recipient email address");
return false;
}
// Set whether the message is multipart/alternative
if(!empty($this->AltBody))
$this->ContentType = "multipart/alternative";
// Attach sender information & date
$header = $this->received();
$header .= sprintf("Date: %s%s", $this->rfc_date(), $this->LE);
$header .= $this->create_header();
if(!$body = $this->create_body())
return false;
$mailqueue_handler =& xoops_getmodulehandler('mail', 'queue');
return $mailqueue_handler->insertMail($header, $body);
}
Then "all" you need is to finish the module so it can be installed (and the database table created) and make a cron job on your SF.net project shell service that fetches all information from the table and sends each row as an email before deleting them from the table.
"When you can flatten entire cities at a whim, a tendency towards quiet reflection and seeing-things-from-the-other-fellow's-point-of-view is seldom necessary."
Cusix Software