• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Mail Queue

R

ragtek

Guest
#1
Is there non Mail Queue available ATM?

The only method i've seen is
PHP:
    public function queue($toEmail, $toName = '', array $headers = array(), $fromEmail = '', $fromName = '', $returnPath = '')
    {
        // TODO: implement (serialize zend_mail object and stick in queue)
        return $this->send($toEmail, $toName, $headers, $fromEmail, $fromName, $returnPath);

        $mailObj = $this->getPreparedMailHandler($toEmail, $toName, $headers, $fromEmail, $fromName, $returnPath);
        if (!$mailObj)
        {
            return false;
        }

        return true;
    }
but as you see, it only executes the normal mail->send method

As i tried to send a mail to 30 people, i got several times a timeout problem.
I don't know why its only happening with my code and not with xenforo, because it's also sending many notification mails at once, when somebody replies to an thread.
 
R

ragtek

Guest
#3
What is the exact timeout error? You say you are using your own code to send emails? What code is that?

I don't see any configurable options in XenForo regarding a mail queue.
1. The xenforo mail class have a queue method, but as i said already, it's using the normal ->send method without an queue feature.

My code is the same as in XenForo_Model_ThreadWatch->sendNotificationToWatchUsersOnReply

PHP:
                foreach ($recivers AS $reciver) {

                    $mail = XenForo_Mail::create('ragtek_nuns_teammail',
                                                $phraseParams,
                                                $reciver['language_id']);
                    $mail->enableAllLanguagePreCache();
                    $mail->queue($reciver['email'], $reciver['username']);
                }
I've implemented now something own (similar to http://framework.zend.com/wiki/display/ZFPROP/Zend_Mail_Transport_Queue+-+Simon+Mundy ) for my own xenforo helper framework