messenger::build_header PHP Метод

build_header() публичный Метод

Return email header
public build_header ( $to, $cc, $bcc )
    function build_header($to, $cc, $bcc)
    {
        global $config, $phpbb_dispatcher;
        // We could use keys here, but we won't do this for 3.0.x to retain backwards compatibility
        $headers = array();
        $headers[] = 'From: ' . $this->from;
        if ($cc) {
            $headers[] = 'Cc: ' . $cc;
        }
        if ($bcc) {
            $headers[] = 'Bcc: ' . $bcc;
        }
        $headers[] = 'Reply-To: ' . $this->replyto;
        $headers[] = 'Return-Path: <' . $config['board_email'] . '>';
        $headers[] = 'Sender: <' . $config['board_email'] . '>';
        $headers[] = 'MIME-Version: 1.0';
        $headers[] = 'Message-ID: <' . $this->generate_message_id() . '>';
        $headers[] = 'Date: ' . date('r', time());
        $headers[] = 'Content-Type: text/plain; charset=UTF-8';
        // format=flowed
        $headers[] = 'Content-Transfer-Encoding: 8bit';
        // 7bit
        $headers[] = 'X-Priority: ' . $this->mail_priority;
        $headers[] = 'X-MSMail-Priority: ' . ($this->mail_priority == MAIL_LOW_PRIORITY ? 'Low' : ($this->mail_priority == MAIL_NORMAL_PRIORITY ? 'Normal' : 'High'));
        $headers[] = 'X-Mailer: phpBB3';
        $headers[] = 'X-MimeOLE: phpBB3';
        $headers[] = 'X-phpBB-Origin: phpbb://' . str_replace(array('http://', 'https://'), array('', ''), generate_board_url());
        /**
         * Event to modify email header entries
         *
         * @event core.modify_email_headers
         * @var	array	headers	Array containing email header entries
         * @since 3.1.11-RC1
         */
        $vars = array('headers');
        extract($phpbb_dispatcher->trigger_event('core.modify_email_headers', compact($vars)));
        if (sizeof($this->extra_headers)) {
            $headers = array_merge($headers, $this->extra_headers);
        }
        return $headers;
    }