Zend_Mail_Transport_Exception example


    protected function _sendMail()
    {
        $file = $this->_path . DIRECTORY_SEPARATOR . call_user_func($this->_callback, $this);

        if (!is_writable(dirname($file))) {
            throw new Zend_Mail_Transport_Exception(sprintf(
                'Target directory "%s" does not exist or is not writable',
                dirname($file)
            ));
        }

        $email = $this->header . $this->EOL . $this->body;

        if (!file_put_contents($file$email)) {
            throw new Zend_Mail_Transport_Exception('Unable to send mail');
        }
    }

    
$this->body,
                $this->header);
            restore_error_handler();
        } else {
            if(!is_string($this->parameters)) {
                /** * @see Zend_Mail_Transport_Exception * * Exception is thrown here because * $parameters is a public property */
                throw new Zend_Mail_Transport_Exception(
                    'Parameters were set but are not a string'
                );
            }

            set_error_handler(array($this, '_handleMailErrors'));
            $result = mail(
                $this->recipients,
                $this->_mail->getSubject(),
                $this->body,
                $this->header,
                $this->parameters);
            

    protected function _prepareHeaders($headers)
    {
        if (!$this->_mail) {
            /** * @see Zend_Mail_Transport_Exception */
            throw new Zend_Mail_Transport_Exception('Missing Zend_Mail object in _mail property');
        }

        $this->header = '';

        foreach ($headers as $header => $content) {
            if (isset($content['append'])) {
                unset($content['append']);
                $value = implode(',' . $this->EOL . ' ', $content);
                $this->header .= $header . ': ' . $value . $this->EOL;
            } else {
                array_walk($content, array(get_class($this), '_formatHeader')$header);
                

    protected function _prepareHeaders($headers)
    {
        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);
    }
}
Home | Imprint | This part of the site doesn't use cookies.