Index: SMTP.php =================================================================== RCS file: /repository/pear/Net_SMTP/SMTP.php,v retrieving revision 1.13 diff -u -r1.13 SMTP.php --- SMTP.php 5 Jan 2003 20:15:52 -0000 1.13 +++ SMTP.php 7 Jan 2003 00:20:32 -0000 @@ -72,6 +72,13 @@ */ var $lastline; + /** + * To allow class debuging + * @var string + */ + var $_debug = false; + + /** * The list of supported authentication methods, ordered by preference. * @var string @@ -159,6 +166,9 @@ $error->getMessage()); } + if($this->_debug){ + echo "DEBUG: Client: $data\n"; + } return true; } @@ -607,6 +617,9 @@ function validateResponse($code) { while ($this->lastline = $this->_socket->readLine()) { + if($this->_debug){ + echo "DEBUG: Server: " . $this->lastline . "\n"; + } $reply_code = strtok($this->lastline, ' '); if (!(strcmp($code, $reply_code))) { $this->code = $reply_code; @@ -640,6 +653,9 @@ $arguments = array(); while ($this->lastline = $this->_socket->readLine()) { + if($this->_debug){ + echo "DEBUG: Server: " . $this->lastline . "\n"; + } $reply_code = strtok($this->lastline, ' '); if (!(strcmp($code, $reply_code))) { $arguments[] = substr($this->lastline, strlen($code) + 1, @@ -659,6 +675,22 @@ return false; } + + + /** + * Sets the debuging information on or off + * + * @param boolean True or false + * + * @return nothing + * @access public + */ + function setDebug($debug = true) + { + $this->_debug = $debug; + } + + } ?>