You are here

public function SMTP::Close in SMTP Authentication Support 7.2

Same name and namespace in other branches
  1. 5 smtp.module \SMTP::Close()
  2. 7 smtp.transport.inc \SMTP::Close()

Closes the socket and cleans up the state of the class. It is not considered good to use this function without first trying to use QUIT. @access public

Return value

void

2 calls to SMTP::Close()
SMTP::Connected in ./smtp.transport.inc
Returns TRUE if connected to a server otherwise FALSE @access public
SMTP::Quit in ./smtp.transport.inc
Sends the quit command to the server and then closes the socket if there is no error or the $close_on_error argument is TRUE.

File

./smtp.transport.inc, line 298
SMTP mail transport class for the smtp module,based on code of the phpmailer library, customized and relicensed to GPLv2

Class

SMTP
SMTP is rfc 821 compliant and implements all the rfc 821 SMTP commands except TURN which will always return a not implemented error. SMTP also provides some utility methods for sending mail to an SMTP server. original author: Chris Ryan

Code

public function Close() {
  $this->error = NULL;

  // so there is no confusion
  $this->helo_rply = NULL;
  if (!empty($this->smtp_conn)) {

    // close the connection and cleanup
    fclose($this->smtp_conn);
    $this->smtp_conn = 0;
  }
}