2

这就是 PHP 文件顶部的内容:

<?php
    // Start the session
    session_start();
?>

<?php
    // Get the PHP helper library from twilio.com/docs/php/install
    require_once('/path/to/twilio-php/Services/Twilio.php'); // Loads the library

    // Your Account Sid and Auth Token from twilio.com/user/account
    $sid = "ACXXXXXXXXXXXXXX"; 
    $token = "XXXXXXXXXXXXXXXXXX"; 
    $client = new Services_Twilio($sid, $token);

    $client->account->messages->sendMessage("+1234567890", "+0987654321", "Please?! I love you <3, Twilio Test");
?>

<?php
    // Start the session
    session_destroy();
?>

然后我有<html>下面。

我遇到的问题是该页面仅加载一个白色空白页面,并且当我检查 Twilio 日志以查看是否记录了任何 SMS 时。

但是页面加载得很好,没有中间的 PHP(应该通过 Twilio 发送 SMS 的部分)

日志完全是空的,并且没有显示任何传出短信的记录。

任何帮助,将不胜感激!

4

1 回答 1

0

你从哪里得到 sendMessage ?根据 Docs,这就是它的完成方式

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "AC8ed2351ef2156d21a66faf913443188c"; 
$token = "{{ auth_token }}"; 
$client = new Services_Twilio($sid, $token);

$sms = $client->account->sms_messages->create("+14158141829", "+14159352345", "Jenny please?! I love you <3", array());
echo $sms->sid;
于 2015-08-27T20:24:14.110 回答