_prepareHeaders example



        // Remove recipient header         unset($headers['To']);

        // Remove subject header, if present         if (isset($headers['Subject'])) {
            unset($headers['Subject']);
        }

        // Prepare headers         parent::_prepareHeaders($headers);

        // Fix issue with empty blank line ontop when using Sendmail Trnasport         $this->header = rtrim($this->header);
    }

    /** * Temporary error handler for PHP native mail(). * * @param int $errno * @param string $errstr * @param string $errfile * @param string $errline * @param array $errcontext * @return true */
if ($count > 1) {
            // Multipart message; create new MIME object and boundary             $mime     = new Zend_Mime($this->_mail->getMimeBoundary());
            $boundary = $mime->boundary();
        } elseif ($this->_isMultipart) {
            // multipart/alternative -- grab boundary             $boundary = $this->_parts[0]->boundary;
        }

        // Determine recipients, and prepare headers         $this->recipients = implode(',', $mail->getRecipients());
        $this->_prepareHeaders($this->_getHeaders($boundary));

        // Create message body         // This is done so that the same Zend_Mail object can be used in         // multiple transports         $message = new Zend_Mime_Message();
        $message->setParts($this->_parts);
        $message->setMime($mime);
        $this->body = $message->generateMessage($this->EOL);

        // Send to transport!         $this->_sendMail();
    }

        if (!$this->_mail) {
            /** * @see Zend_Mail_Transport_Exception */
            throw new Zend_Mail_Transport_Exception('_prepareHeaders requires a registered Zend_Mail object');
        }

        unset($headers['Bcc']);

        // Prepare headers         parent::_prepareHeaders($headers);
    }
}
if ($this->_queryBracketsEscaped) {
                        $query = preg_replace('/%5B(?:[0-9]|[1-9][0-9]+)%5D=/', '=', $query);
                    } else {
                        $query = preg_replace('/\\[(?:[0-9]|[1-9][0-9]+)\\]=/', '=', $query);
                    }
                }

                $uri->setQuery($query);
            }

            $body = $this->_prepareBody();
            $headers = $this->_prepareHeaders();

            // check that adapter supports streaming before using it             if(is_resource($body) && !($this->adapter instanceof Zend_Http_Client_Adapter_Stream)) {
                /** @see Zend_Http_Client_Exception */
                throw new Zend_Http_Client_Exception('Adapter does not support streaming');
            }

            // Open the connection, send the request and read the response             $this->adapter->connect($uri->getHost()$uri->getPort(),
                ($uri->getScheme() == 'https' ? true : false));

            
Home | Imprint | This part of the site doesn't use cookies.