You are here

private function SMTP::get_lines in SMTP Authentication Support 7.2

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

Read in as many lines as possible either before eof or socket timeout occurs on the operation. With SMTP we can tell if we have more lines to read if the 4th character is '-' symbol. If it is a space then we don't need to read anything else. @access private

Return value

string

10 calls to SMTP::get_lines()
SMTP::Authenticate in ./smtp.transport.inc
Performs SMTP authentication. Must be run after running the Hello() method. Returns TRUE if successfully authenticated. @access public
SMTP::Connect in ./smtp.transport.inc
Connect to the server specified on the port specified. If the port is not specified use the default SMTP_PORT. If tval is specified then a connection will try and be established with the server for that number of seconds. If tval is not specified the…
SMTP::Data in ./smtp.transport.inc
Issues a data command and sends the msg_data to the server finializing the mail transaction. $msg_data is the message that is to be send with the headers. Each header needs to be on a single line followed by a <CRLF> with the message headers and…
SMTP::Mail in ./smtp.transport.inc
Starts a mail transaction from the email address specified in $from. Returns TRUE if successful or FALSE otherwise. If True the mail transaction is started and then one or more Recipient commands may be called followed by a Data command.
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.

... See full list

File

./smtp.transport.inc, line 798
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

private function get_lines() {
  $data = "";
  while ($str = @fgets($this->smtp_conn, 515)) {
    if ($this->do_debug >= 4) {
      drupal_set_message(t("SMTP -> get_lines(): \$data was \"@data\"", array(
        "@data" => $data,
      )));
      drupal_set_message(t("SMTP -> get_lines(): \$str is \"@str\"", array(
        "@str" => $str,
      )));
    }
    $data .= $str;
    if ($this->do_debug >= 4) {
      drupal_set_message(t("SMTP -> get_lines(): \$data was \"@data\"", array(
        "@data" => $data,
      )));
    }

    // if 4th character is a space, we are done reading, break the loop
    if (substr($str, 3, 1) == " ") {
      break;
    }
  }
  return $data;
}