Zend_Mime example


    protected function _buildBody()
    {
        if (($text = $this->_mail->getBodyText())
            && ($html = $this->_mail->getBodyHtml()))
        {
            // Generate unique boundary for multipart/alternative             $mime = new Zend_Mime(null);
            $boundaryLine = $mime->boundaryLine($this->EOL);
            $boundaryEnd  = $mime->mimeEnd($this->EOL);

            $text->disposition = false;
            $html->disposition = false;

            $body = $boundaryLine
                  . $text->getHeaders($this->EOL)
                  . $this->EOL
                  . $text->getContent($this->EOL)
                  . $this->EOL
                  .
/** * Returns the Zend_Mime object in use by the message * * If the object was not present, it is created and returned. Can be used to * determine the boundary used in this message. * * @return Zend_Mime */
    public function getMime()
    {
        if ($this->_mime === null) {
            $this->_mime = new Zend_Mime();
        }

        return $this->_mime;
    }

    /** * Generate MIME-compliant message from the current configuration * * This can be a multipart message if more than one MIME part was added. If * only one part is present, the content of this part is returned. If no * part had been added, an empty string is returned. * * Parts are seperated by the mime boundary as defined in Zend_Mime. If * {@link setMime()} has been called before this method, the Zend_Mime * object set by this call will be used. Otherwise, a new Zend_Mime object * is generated and used. * * @param string $EOL EOL string; defaults to {@link Zend_Mime::LINEEND} * @return string */
Home | Imprint | This part of the site doesn't use cookies.