All Products
Document Center


Last Updated:Oct 10, 2023

This topic provides a comprehensive guide on how to utilize Alibaba Cloud SMS SDK for PHP. By incorporating this SDK as a dependency in your application, you can easily integrate the SendMessageToGlobe operation, enabling you to send SMS messages to various regions around the world, excluding the Chinese mainland.

Usage notes

  • You must set the regionId parameter to ap-southeast-1.

  • You must set the product parameter to Dysmsapi.

  • You must set the host parameter to

  • You must set the version parameter to 2018-05-01.

Sample code

use AlibabaCloud\Client\AlibabaCloud;
use AlibabaCloud\Client\Exception\ClientException;
use AlibabaCloud\Client\Exception\ServerException;
// Download:
// Usage:
AlibabaCloud::accessKeyClient('<accessKeyId>', '<accessSecret>')
try {
    $result = AlibabaCloud::rpcRequest()
                                        'query' => [
                                            "To" => "62123****8901",
                                            "From" => "1234567890",
                                            "Message" => "have a test.",