setAccessKey("your ak"); $client->setSecretKey("your sk"); // template $template = [ 'code' => 1111, ]; $body = [ 'SmsAccount' => "your sms account", 'Sign' => "sign", "TemplateID"=> "ST_xxx", "TemplateParam"=> json_encode($template), "PhoneNumbers"=> "phone numbers", "Tag"=> "tag", ]; $response = $client->sendSms(['json' => $body]); echo $response;