选择语言 :

 Core_Email::batch_bcc_send

Batch Bcc Send. Sends groups of BCCs in batches

void Core_Email::batch_bcc_send( )
返回值
  • void
File: ./core/classes/email.class.php
public function batch_bcc_send()
{
    $float = $this->bcc_batch_size - 1;
    $set = '';
    $chunk = array();

    for ($i = 0, $c = count($this->_bcc_array); $i < $c; $i++)
    {
        if (isset($this->_bcc_array[$i]))
        {
            $set .= ', '.$this->_bcc_array[$i];
        }

        if ($i === $float)
        {
            $chunk[] = substr($set, 1);
            $float += $this->bcc_batch_size;
            $set = '';
        }

        if ($i === $c-1)
        {
            $chunk[] = substr($set, 1);
        }
    }

    for ($i = 0, $c = count($chunk); $i < $c; $i++)
    {
        unset($this->_headers['Bcc']);

        $bcc = $this->clean_email($this->_str_to_array($chunk[$i]));

        if ($this->protocol !== 'smtp')
        {
            $this->set_header('Bcc', implode(', ', $bcc));
        }
        else
        {
            $this->_bcc_array = $bcc;
        }

        $this->_build_message();
        $this->_spool_email();
    }
}