【发布时间】:2016-11-02 08:32:34
【问题描述】:
我正在使用 twilio api 发送消息。 以下是我的脚本。
$AccountSid = "xxxxxxxxxxxxx";
$AuthToken = "xxxxxxxxxxxx";
$from = 'xxxxxxx';
$to = '+91xxxxxxxxxxxxx';
$uri = 'https://api.twilio.com/2010-04-01/Accounts/' .$AccountSid . '/SMS/Messages';
$auth = $AccountSid . ':' . $AuthToken;
$fields = '&To='.urlencode( $to ).'&From='.urlencode($from).'&Body='. urlencode('This is my test message');
$res = curl_init();
curl_setopt( $res, CURLOPT_URL, $uri );
curl_setopt( $res, CURLOPT_POST, 3 );
curl_setopt( $res, CURLOPT_POSTFIELDS, $fields );
curl_setopt( $res, CURLOPT_USERPWD, $auth );
curl_setopt( $res, CURLOPT_RETURNTRANSFER, true );
$result = curl_exec( $res );
return $result;
我的手机没有收到短信。
twilio 是否适用于印度手机号码?
【问题讨论】:
-
@Ramya.twillo 为印度手机号码工作。您已添加到 +91
-
我在我的号码上添加了 +91
-
@Ramya.you 可以检查 Gowri 的答案,因为我也有同样的想法。如果您的 Twilio 帐户处于跟踪模式,那么您将不会收到短信
标签: php twilio-php