/**
  * Initializes service from gateway
  * @param Varien_Object $gateway Object with all connection params
  * @return
  */
 public function initFromVarienObject(Varien_Object $gateway)
 {
     $this->setType($gateway->getProtocol())->setHost($gateway->getHost())->setLogin($gateway->getLogin())->setPassword($gateway->getPassword())->setPort($gateway->getPort())->setSecure($this->_getGatewaySecure($gateway));
     $instanceConstructor = $this->_getConnectionConstructor();
     try {
         // Try to connect
         $this->setInstance(new $instanceConstructor($this->_getConnectionParams()));
     } catch (Zend_Mail_Protocol_Exception $e) {
         $this->log($e->getMessage());
         return $e->getMessage();
     }
     return true;
 }