Esempio n. 1
0
 /**
  * Returns the transport with the server/auth information from the specified
  * account, along with the configuration's smtp client name for using when
  * helo'ing the mail server.
  *
  * @param Conjoon_Modules_Groupware_Email_Account $account The account for
  *        which the transport should be returned
  *
  * @return Conjoon\Mail\Transport\Smtp
  */
 protected function getTransportForAccount(\Conjoon_Modules_Groupware_Email_Account $account)
 {
     $regCon = $this->getApplicationConfiguration();
     $clientName = $regCon->application->mail->smtp->client_name;
     $config = array();
     if ($account->isOutboxAuth()) {
         $config = array('name' => $clientName, 'auth' => 'login', 'username' => $account->getUsernameOutbox(), 'password' => $account->getPasswordOutbox(), 'port' => $account->getPortOutbox());
         $ssl = $account->getOutboxConnectionType();
         if ($ssl == 'SSL' || $ssl == 'TLS') {
             $config['ssl'] = $ssl;
         }
     }
     /**
      * @see \Conjoon\Mail\Transport\Smtp
      */
     require_once 'Conjoon/Mail/Transport/Smtp.php';
     return new \Conjoon\Mail\Transport\Smtp($account->getServerOutbox(), $config);
 }