Example #1
0
 /**
  * Try to get a suitable response to the DATA command
  * @return string response
  */
 public function getDataGoAhead()
 {
     if ($this->validCommandSent && $this->rcptSent && !$this->dataSent) {
         if (preg_match("/^\\s*data\\s*\r\n/i", $this->stream->command)) {
             $this->validCommandSent = true;
             $this->dataSent = true;
             $this->mailSent = false;
             $this->rcptSent = false;
             $this->ending = "\r\n.\r\n";
             return SmtpMsgStub::dataGoAhead();
         } else {
             return $this->getBadCommand();
         }
     } else {
         return $this->getBadCommand();
     }
 }