src/API.php
public function sendBatch(array $messages)
    {
        $body = '';
        /** @var Message\Message $message */
        foreach ($messages as $i => $message) {
            if (!$message instanceof Message\Message) {
                throw new InvalidArgumentException();
            }

            $body .= "[{$i}]\n";
            $body .= $message->toINI();
        }
        $body = trim($body);

        $request = $this->client->newRequest(
            'POST',
            $this->client->buildUriWithQuery('/SmSendPost.asp', ['encoding' => 'UTF8']),
            'text/plain',
            $body
        );

        $response = $this->client->sendRequest($request);

        return $this->parseMessageResponse($response);
    }
public function sendBatch(array $messages)
    {
        $body = '';
        /** @var Message\Message $message */
        foreach ($messages as $i => $message) {
            if (!$message instanceof Message\Message) {
                throw new InvalidArgumentException();
            }

            $body .= "[{$i}]\n";
            $body .= $message->toINI();
        }
        $body = trim($body);

        $request = $this->client->newRequest(
            'POST',
            $this->client->buildUriWithQuery('/SmSendPost.asp', ['encoding' => 'UTF8']),
            'text/plain',
            $body
        );

        $response = $this->client->sendRequest($request);

        return $this->parseMessageResponse($response);
    }
public function sendBatch ( array $ messages ) { $ body = '' ; /** @var Message\Message $message */ foreach ( $ messages as $ i => $ message ) { if ( ! $ message instanceof Message \ Message ) { throw new InvalidArgumentException ( ) ; } $ body .= "[{$i}]\n" ; $ body .= $ message -> toINI ( ) ; } $ body = trim ( $ body ) ; $ request = $ this -> client -> newRequest ( 'POST' , $ this -> client -> buildUriWithQuery ( '/SmSendPost.asp' , [ 'encoding' => 'UTF8' ] ) , 'text/plain' , $ body ) ; $ response = $ this -> client -> sendRequest ( $ request ) ; return $ this -> parseMessageResponse ( $ response ) ; }
Send multiple SMS

@param Message\Message[] $messages
@return Message\Response
@throws Exception\BadResponseException
@throws InvalidArgumentException
@throws \GuzzleHttp\Exception\GuzzleException
Send multiple SMS