public function useAccount($accountName)
    {
        //If a mail object exists, overwrite with new object
        if ($this->_mail)
            $this->_constructMail();

        $this->useAccount = $accountName;
        $account = $this->accounts->get($accountName);

        if ($account->isSMTP == "Y") {
            if ($account->sMTPAuth == "Y") {
                $config = array('auth' => 'login', 'username' => $account->username, 'password' => $account->password, "port" => $account->port, 'ssl' => $account->sSL);
            } else {
                $config = array();
            }
            $mailTransport = new \Zend_Mail_Transport_Smtp($account->host, $config);
            $this->_mail->setDefaultTransport($mailTransport);
        } else {
            require_once 'Zend/Mail/Transport/Sendmail.php';
            $mailTransport = new \Zend_Mail_Transport_Sendmail();
            $this->_mail->setDefaultTransport($mailTransport);
        }
        $this->_mail->setFrom($account->fromEmail, $account->fromName);
        return $this;
    }
public function useAccount($accountName)
    {
        //If a mail object exists, overwrite with new object
        if ($this->_mail)
            $this->_constructMail();

        $this->useAccount = $accountName;
        $account = $this->accounts->get($accountName);

        if ($account->isSMTP == "Y") {
            if ($account->sMTPAuth == "Y") {
                $config = array('auth' => 'login', 'username' => $account->username, 'password' => $account->password, "port" => $account->port, 'ssl' => $account->sSL);
            } else {
                $config = array();
            }
            $mailTransport = new \Zend_Mail_Transport_Smtp($account->host, $config);
            $this->_mail->setDefaultTransport($mailTransport);
        } else {
            require_once 'Zend/Mail/Transport/Sendmail.php';
            $mailTransport = new \Zend_Mail_Transport_Sendmail();
            $this->_mail->setDefaultTransport($mailTransport);
        }
        $this->_mail->setFrom($account->fromEmail, $account->fromName);
        return $this;
    }
public function useAccount ( $ accountName ) { //If a mail object exists, overwrite with new object if ( $ this -> _mail ) $ this -> _constructMail ( ) ; $ this -> useAccount = $ accountName ; $ account = $ this -> accounts -> get ( $ accountName ) ; if ( $ account -> isSMTP == "Y" ) { if ( $ account -> sMTPAuth == "Y" ) { $ config = array ( 'auth' => 'login' , 'username' => $ account -> username , 'password' => $ account -> password , "port" => $ account -> port , 'ssl' => $ account -> sSL ) ; } else { $ config = array ( ) ; } $ mailTransport = new \ Zend_Mail_Transport_Smtp ( $ account -> host , $ config ) ; $ this -> _mail -> setDefaultTransport ( $ mailTransport ) ; } else { require_once 'Zend/Mail/Transport/Sendmail.php' ; $ mailTransport = new \ Zend_Mail_Transport_Sendmail ( ) ; $ this -> _mail -> setDefaultTransport ( $ mailTransport ) ; } $ this -> _mail -> setFrom ( $ account -> fromEmail , $ account -> fromName ) ; return $ this ; }
Will set the Default Transport object for the mail object based on the supplied accountname

@param string $accountName
@return boolean TRUE/FALSE
Will set the Default Transport object for the mail object based on the supplied accountname