예제 #1
0
    if (!empty($matches)) {
        Pommo::$_session['personalization'] = TRUE;
    }
    // cache personalizations in session
    if (Pommo::$_session['personalization']) {
        Pommo::$_session['personalization_body'] = Pommo_Helper_Personalize::search($mailing->_mailing['body']);
        Pommo::$_session['personalization_altbody'] = Pommo_Helper_Personalize::search($mailing->_mailing['altbody']);
    }
}
/**********************************
 * PREPARE THE MAILER
 *********************************/
$html = $mailing->_mailing['ishtml'] == 'on' ? TRUE : FALSE;
$mailer = new Pommo_Mailer($mailing->_mailing['fromname'], $mailing->_mailing['fromemail'], $mailing->_mailing['frombounce'], $config['list_exchanger'], NULL, $mailing->_mailing['charset'], Pommo::$_session['personalization']);
if (!$mailer->prepareMail($mailing->_mailing['subject'], $mailing->_mailing['body'], $html, $mailing->_mailing['altbody'], $mailing->_mailing['attachments'])) {
    $mailer->shutdown('*** ERROR *** prepareMail() returned errors.');
}
// Set appropriate SMTP relay
if ($config['list_exchanger'] == 'smtp') {
    $mailer->setRelay(unserialize($config['smtp_1']));
    $mailer->SMTPKeepAlive = TRUE;
}
// necessary? (better method!)
$mailing->attach('_mailer', $mailer);
/**********************************
 * INITIALIZE Throttler
 *********************************/
$tid = 1;
// forced shared throttler, until swiftmailer implementation
//$tid = ($config['throttle_SMTP'] == 'shared') ? 1 : $relayID; /* old shared throttle support */
if (empty(Pommo::$_session['throttler'][$tid])) {