Merge 1db5a32683 into ebf1655bd5
This commit is contained in:
commit
57e23954b5
16
src/SMTP.php
16
src/SMTP.php
|
|
@ -275,6 +275,12 @@ class SMTP
|
|||
*/
|
||||
protected $last_reply = '';
|
||||
|
||||
/**
|
||||
* Whether we are in the DATA phase or not
|
||||
* @var bool
|
||||
*/
|
||||
private $inData = false;
|
||||
|
||||
/**
|
||||
* Output debugging info via a user-selected method.
|
||||
*
|
||||
|
|
@ -806,9 +812,12 @@ class SMTP
|
|||
{
|
||||
//This will use the standard timelimit
|
||||
if (!$this->sendCommand('DATA', 'DATA', 354)) {
|
||||
$this->inData = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->inData = true;
|
||||
|
||||
/* The server is ready to accept data!
|
||||
* According to rfc821 we should not send more than 1000 characters on a single line (including the LE)
|
||||
* so we will break the data up into lines by \r and/or \n then if needed we will break each of those into
|
||||
|
|
@ -881,6 +890,7 @@ class SMTP
|
|||
$this->recordLastTransactionID();
|
||||
//Restore timelimit
|
||||
$this->Timelimit = $savetimelimit;
|
||||
$this->inData = false;
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
|
@ -1020,7 +1030,11 @@ class SMTP
|
|||
*/
|
||||
public function quit($close_on_error = true)
|
||||
{
|
||||
$noerror = $this->sendCommand('QUIT', 'QUIT', 221);
|
||||
if ($this->inData) {
|
||||
$noerror = true;
|
||||
} else {
|
||||
$noerror = $this->sendCommand('QUIT', 'QUIT', 221);
|
||||
}
|
||||
$err = $this->error; //Save any error
|
||||
if ($noerror || $close_on_error) {
|
||||
$this->close();
|
||||
|
|
|
|||
Loading…
Reference in New Issue