function SMTP::close

5.x SMTP.php public SMTP::close()

Close the socket and clean up the state of the class. Don't use this function without first trying to use QUIT.

See also

quit()

File

inc/PHPMailer/src/SMTP.php, line 615

Class

SMTP
PHPMailer RFC821 SMTP email transport class. Implements RFC 821 SMTP commands and provides some utility methods for sending mail to an SMTP server.

Code

public function close() {
  $this->setError('');
  $this->server_caps = null;
  $this->helo_rply = null;
  if (is_resource($this->smtp_conn)) {
    // close the connection and cleanup
    fclose($this->smtp_conn);
    $this->smtp_conn = null; //Makes for cleaner serialization
    $this->edebug('Connection: closed', self::DEBUG_CONNECTION);
  }
}