/** * SMTP RCPT TO * SUCCESS 250 * @return $this * @throws CodeException * @throws SMTPException */ protected function rcptTo() { $to = array_merge($this->message->getTo(), $this->message->getCc(), $this->message->getBcc()); foreach ($to as $toEmail => $_) { $in = "RCPT TO:<" . $toEmail . ">" . $this->CRLF; $code = $this->pushStack($in); if ($code !== '250') { throw new CodeException('250', $code, array_pop($this->resultStack)); } } return $this; }