You are here

function SMTP::Close in SMTP Authentication Support 5

Same name and namespace in other branches
  1. 7.2 smtp.transport.inc \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.module
Returns true if connected to a server otherwise false @access private
SMTP::Quit in ./smtp.module
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.module, line 2205
Enables drupal to send email directly to an SMTP server using authentication. Uses the PHPMailer class by Brent R. Matzelle.

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. @package PHPMailer @author Chris Ryan

Code

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;
  }
}