parent
2f5c94fe74
commit
1db5a32683
16
src/SMTP.php
16
src/SMTP.php
|
|
@ -264,6 +264,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.
|
||||
*
|
||||
|
|
@ -737,9 +743,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
|
||||
|
|
@ -811,6 +820,7 @@ class SMTP
|
|||
$this->recordLastTransactionID();
|
||||
//Restore timelimit
|
||||
$this->Timelimit = $savetimelimit;
|
||||
$this->inData = false;
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
|
@ -941,7 +951,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