public function setFrom($email, $name = null)
    {
        if (null !== $this->_from) {
            /**
             * @see Zend_Mail_Exception
             */
            // require_once 'Zend/Mail/Exception.php';
            throw new Zend_Mail_Exception('From Header set twice');
        }

        $email = $this->_filterEmail($email);
        $name  = $this->_filterName($name);
        $this->_from = $email;
        $this->_storeHeader('From', $this->_formatAddress($email, $name), true);

        return $this;
    }
public function setFrom($email, $name = null)
    {
        if (null !== $this->_from) {
            /**
             * @see Zend_Mail_Exception
             */
            // require_once 'Zend/Mail/Exception.php';
            throw new Zend_Mail_Exception('From Header set twice');
        }

        $email = $this->_filterEmail($email);
        $name  = $this->_filterName($name);
        $this->_from = $email;
        $this->_storeHeader('From', $this->_formatAddress($email, $name), true);

        return $this;
    }
public function setFrom ( $ email , $ name = null ) { if ( null !== $ this -> _from ) { /**
             * @see Zend_Mail_Exception
             */ // require_once 'Zend/Mail/Exception.php'; throw new Zend_Mail_Exception ( 'From Header set twice' ) ; } $ email = $ this -> _filterEmail ( $ email ) ; $ name = $ this -> _filterName ( $ name ) ; $ this -> _from = $ email ; $ this -> _storeHeader ( 'From' , $ this -> _formatAddress ( $ email , $ name ) , true ) ; return $ this ; }
Sets From-header and sender of the message

@param  string    $email
@param  string    $name
@return Zend_Mail Provides fluent interface
@throws Zend_Mail_Exception if called subsequent times
Sets From - header and sender of the message