https://account.alibabacloud.com/login/login.htm?spm=a212t0.3047821.0.0.166a1b05yDApSQ&lang=zh_CN
https://www.alibabacloud.com/help/zh/doc-detail/164745.htm?spm=a2c63.p38356.b99.36.7a0b2cafsr44zk
composer require alibabacloud/client
<?php
use AlibabaCloud\Client\AlibabaCloud;
use AlibabaCloud\Client\Exception\ClientException;
use AlibabaCloud\Client\Exception\ServerException;
// Download:https://github.com/aliyun/openapi-sdk-php-client
// Usage:https://github.com/aliyun/openapi-sdk-php-client/blob/master/README-CN.md
AlibabaCloud::accessKeyClient('<accessKeyId>', '<accessSecret>')
->regionId('ap-southeast-1')
->asGlobalClient();
try {
$result = AlibabaCloud::rpcRequest()
->product('Dysmsapi')
->host('dysmsapi.ap-southeast-1.aliyuncs.com')
->version('2018-05-01')
->action('SendMessageToGlobe')
->method('POST')
->options([
'query' => [
"To" => "62123****8901",
// "From" => "1234567890",
"Message" => "have a test.",
],
])
->request();
print_r($result->toArray());
} catch (ClientException $e) {
echo $e->getErrorMessage() . PHP_EOL;
} catch (ServerException $e) {
echo $e->getErrorMessage() . PHP_EOL;
}