Issues RCPT command

@param  string $to Receiver(s) mailbox
@throws Zend_Mail_Protocol_Exception
@return void
336692
public function rcpt($to)
    {
        if ($this->_mail !== true) {
            /**
             * @see Zend_Mail_Protocol_Exception
             */
            // require_once 'Zend/Mail/Protocol/Exception.php';
            throw new Zend_Mail_Protocol_Exception('No sender reverse path has been supplied');
        }

        // Set rcpt to true, as per 4.1.1.3 of RFC 2821
        $this->_send('RCPT TO:<' . $to . '>');
        $this->_expect(array(250, 251), 300); // Timeout set for 5 minutes as per RFC 2821 4.5.3.2
        $this->_rcpt = true;
    }
378350
public function setTo($to) {
        if (!is_array($to)) {
            $to = array($to, '');
        }
        $this->_params['to'] = $to;
        return $this;
    }
981587
public function send(Message $mail): void
    {
        if (!$this->mailers) {
            throw new InvalidArgumentException('At least one mailer must be provided.');
        }

        $failures = [];
        for ($i = 0; $i < $this->retryCount; $i++) {
            if ($i > 0) {
                \usleep($this->retryWaitTime * 1000);
            }

            foreach ($this->mailers as $mailer) {
                try {
                    $mailer->send($mail);

                    return;

                } catch (SendException $e) {
                    $failures[] = $e;
                    null === $this->onFailure || ($this->onFailure)($this, $e, $mailer, $mail);
                }
            }
        }

        $e = new FallbackMailerException('All mailers failed to send the message.');
        $e->failures = $failures;
        throw $e;
    }
1030167
public function reset() {
        if (!is_resource($this->connection))
            throw new RuntimeException('Cannot reset connection: Not connected');

        $this->writeData('RSET');
        $response = $this->readResponse();

        $this->parseResponse($response);
        if ($this->responseStatus != 250)
            throw new RuntimeException('RSET command not accepted: '.$this->responseStatus.' '.$this->response.NL.NL.'SMTP transfer log:'.NL.'------------------'.NL.$this->logBuffer);
    }
693314
public function afterPatch( $from, $to )
    {
        $schema = $this->getPatchData()
                       ->get( 'db', 'schema' );

        if ( is_array( $schema ) )
        {
            $schema = reset( $schema );
        }

        if ( $this->isZeroVersion( $from ) )
        {
            $developer = $this->selectFromTable( 'user', 'id', array(
                'groupId' => static::DEVELOPER_GROUP,
            ) );

            if ( ! $developer )
            {
                $developer = $this->insertDeveloper();
            }

            $platformOwner = $this->selectFromTable( 'user', 'id', array(
                'groupId' => static::SITE_OWNER_GROUP,
            ) );

            if ( ! $platformOwner )
            {
                $platformOwner = $this->insertPlatformOwner();
            }

            $content = $this->selectFromTable( 'paragraph', 'id', array(
                'type' => 'content',
            ) );

            if ( ! $content )
            {
                $content = $this->insertDefaultParagraph( 'content' );
            }

            $menu = $this->selectFromTable( 'menu', 'id' );

            if ( ! $menu )
            {
                $menu = $this->insertDefaultMenu( $content );
            }

            $layout = $this->selectFromTable( 'paragraph', 'id', array(
                'type' => 'layout',
            ) );

            if ( ! $layout )
            {
                $layout = $this->insertDefaultParagraph( 'layout' );
            }

            $subDomain = $this->selectFromTable( 'subdomain', 'id', array(
                'subdomain' => '',
            ) );

            if ( ! $subDomain )
            {
                $subDomain = $this->insertDefaultSubDomain( $layout, $content );
            }

            if ( ! empty( $schema ) )
            {
                foreach ( $this->uploadsDirs as $uploadsDir )
                {
                    @ mkdir(
                        implode( DIRECTORY_SEPARATOR, array(
                            '.',
                            'public',
                            'uploads',
                            $schema,
                            str_replace( '/', DIRECTORY_SEPARATOR, $uploadsDir )
                        ) ),
                        0777,
                        true
                    );
                }

                foreach ( $this->uploadsFiles as $uploadsFile => $copyFrom )
                {
                    @ copy(
                        str_replace( '/', DIRECTORY_SEPARATOR, $copyFrom ),
                        implode( DIRECTORY_SEPARATOR, array(
                            '.',
                            'public',
                            'uploads',
                            $schema,
                            str_replace( '/', DIRECTORY_SEPARATOR, $uploadsFile )
                        ) )
                    );
                }
            }
        }
        else
        {
            $schemas = array( $schema );

            if ( $this->getPatcher()
                      ->isMultisite() )
            {
                $schemas = $this->selectColumnFromTable(
                    array( '_central', 'site' ),
                    'schema'
                );
            }

            foreach ( $schemas as $schema )
            {
                $extraCssFile = 'public/uploads/' . $schema . '/customize/extra.css';

                if ( file_exists( $extraCssFile ) && is_readable( $extraCssFile ) )
                {
                    $extraCss = preg_replace(
                        '/^\s*@charset\s+(["\'][^"\']+["\']|[^;]+)\s*;\s+/',
                        '',
                        @ file_get_contents( $extraCssFile )
                    );

                    if ( ! empty( $extraCss ) )
                    {
                        $this->appendCustomizeGlobalExtra( $extraCss, $schema );
                        $this->getInstaller()
                             ->patchLog( 'customize extra %s merged', $extraCssFile );
                    }

                    @ unlink( $extraCssFile );
                }
            }
        }

        $this->mergePackagesConfig();
    }
572551
public function send($to)
    {
        // will throw exception
        $this->testValidateMessageParts();

        $message = $this->createMessage($to);

        return $this->mailManager->send($message);
    }
684446
public function data($data)
    {
        if ($this->_rcpt == false) {
            throw new SMTPException(__('Must call RCPT before calling DATA'));
        }

        $this->_send('DATA');
        $this->_expect(354, 120);

        foreach ($this->_header_fields as $name => $body) {
            // Every header can contain an array. Will insert multiple header fields of that type with the contents of array.
            // Useful for multiple recipients, for instance.
            if (!is_array($body)) {
                $body = array($body);
            }

            foreach ($body as $val) {
                $this->_send($name . ': ' . $val);
            }
        }
        // Send an empty newline. Solves bugs with Apple Mail
        $this->_send('');

        // Because the message can contain \n as a newline, replace all \r\n with \n and explode on \n.
        // The send() function will use the proper line ending (\r\n).
        $data = str_replace("\r\n", "\n", $data);
        $data_arr = explode("\n", $data);

        foreach ($data_arr as $line) {
            // Escape line if first character is a period (dot). http://tools.ietf.org/html/rfc2821#section-4.5.2
            if (strpos($line, '.') === 0) {
                $line = '.' . $line;
            }
            $this->_send($line);
        }

        $this->_send('.');
        $this->_expect(250, 600);
        $this->_data = true;
    }
1145736
protected function assertNoAdditionalNewlinesForEmptyBody(File $phpcsFile, int $from, int $to): void
    {
        $tokens = $phpcsFile->getTokens();

        $startLine = $tokens[$from]['line'];
        $endLine = $tokens[$to]['line'];
        if ($endLine === $startLine + 2) {
            $error = 'There should be no extra newline in empty methods';
            if ($phpcsFile->addFixableError($error, $from, 'ContentEmpty')) {
                $phpcsFile->fixer->replaceToken($from + 1, '');
            }
        }
    }
708510
public function composingStart($to)
    {
        $message = new \sb\XMPP\Message();

        $message->setTo($to);
        $message->setFrom($this->jid);
        $message->setType('chat');
        $node = $message->createElement('composing');
        $attr = $message->createAttribute('xmlns');
        $node->appendChild($attr);
        $attr->appendChild($message->createTextNode('http://jabber.org/protocol/chatstates'));

        $message->doc->appendChild($node);

        $this->sendMessage($message);
    }
1255353
public function sendTemplateSms($to, $tempId, array $tempData)
    {
        $params = [
            'method'             => 'alibaba.aliqin.fc.sms.num.send',
            'sms_type'           => 'normal',
            'sms_free_sign_name' => $this->smsFreeSignName,
            'sms_param'          => $this->getTempDataString($tempData),
            'rec_num'            => $to,
            'sms_template_code'  => $tempId,
        ];
        $this->request($params);
    }
1015254
public void setTo(Object to) throws ApplicationException {
	if (StringUtil.isEmpty(to)) return;
	try {
	    smtp.addTo(to);
	}
	catch (Exception e) {
	    throw new ApplicationException("attribute [to] of the tag [mail] is invalid", e.getMessage());
	}
    }
912582
public function setOptInEmailStatus($iStatus)
    {
        $this->oxnewssubscribed__oxemailfailed = new \OxidEsales\Eshop\Core\Field($iStatus, \OxidEsales\Eshop\Core\Field::T_RAW);
        $this->save();
    }
911850
protected function sendMessageTo($source, $from, $to, $subject, $body) {
		if($to instanceof Member) $to = $to->Email;
		$this->sendViaEmail($source, $from, $to, $subject, $body);
	}
443065
public function sendPresenceUnsubscription($to)
    {
        $node = new ProtocolNode('presence', ['type' => 'unsubscribe', 'to' => $this->getJID($to)], null, '');
        $this->sendNode($node);
    }
136269
public function sendMessageRead($to, $id)
    {
        $listNode = null;
        $idNode = $id;
        if (is_array($id) && count($id > 1)) {
            $idNode = array_shift($id);
            foreach ($id as $itemId) {
                $items[] = new ProtocolNode('item',
                [
                  'id' => $itemId,
                ], null, null);
            }
            $listNode = new ProtocolNode('list', null, $items, null);
        }

        $messageNode = new ProtocolNode('receipt',
        [
          'type' => 'read',
          't'    => time(),
          'to'   => $this->getJID($to),
          'id'   => $idNode,
        ], [$listNode], null);

        $this->sendNode($messageNode);
    }
659603
public function setTo($to = [])
    {
        $this->to = $to;
        $this->debug->debug(__FUNCTION__, 'setTo: ', $this->to);
    }
1342535
protected function rset()
        {
            $this->send('RSET');
            // MS ESMTP doesn't follow RFC according to ZF tracker, see [ZF-1377]
            $expected = array(
                self::SMTP_GENERIC_SUCCESS,
                self::SMTP_CONNECT_SUCCESS,
                // hotmail returns this o_O
                self::SMTP_TRANSACTION_FAILED
            );
            $this->expect($expected, $this->command_timeouts['rset']);
            $this->state['mail'] = false;
            $this->state['rcpt'] = false;
        }