keepConnection() public method

This method should be called prior to the first call to send(). Keeping the connection open is useful if you are sending a lot of mail. It removes the overhead of opening the connection after each mail is sent. Use disconnect() to close the connection if you have requested to keep it open.
public keepConnection ( )
Esempio n. 1
0
 public function testFullMailMultipleKeepConnection()
 {
     $transport = new ezcMailSmtpTransport(self::HOST_PLAIN, self::USER_PLAIN, self::PASS_PLAIN, self::PORT_PLAIN);
     try {
         $transport->keepConnection();
         $this->mail->subject = __CLASS__ . ':' . __FUNCTION__;
         $transport->send($this->mail);
         $transport->send($this->mail);
     } catch (ezcMailTransportException $e) {
         $this->fail($e->getMessage());
     }
 }