twilio发送短信 php

  • composer安装sdk
  • 发送demo
// Your Account SID from www.twilio.com/console
$sid = "ACe161***********************defeab"; 
// Your Auth Token from www.twilio.com/console
$token = "c400b4***********************58814728"; 
//messagingServiceSid
$mssid = "MGd4329***********************a6bc837";
$client = new Client($sid, $token);
$message = $client->messages->create(
        '+86183********63',
        [
            'messagingServiceSid'   => $mssid,
            'from'                              => '+177********386',
            'body'                             => '这里是短信内容'
        ]
);
dd($message);
dd($message->sid);

发送成功会返回sid

sms

© 版权声明
THE END
喜欢就支持一下吧
分享