如何通过 plivo api 发送短信它说需要供应商/autoload.php 但我找不到任何 autoload.php,当我运行它时它也有 composer.json 这是错误
找不到类“GuzzleHttp\Client”
这是我的代码
<form action="send_sms_from_browser.php" method="post">
From No:<input type="text" name="From"><br><br>
To No:<input type="text" name="To"><br><br>
Message:<br>
<textarea name="Text" rows="3" cols="30" >Message Text</textarea><br> <br>
<input type="submit" value="Send SMS">
</form>
error_reporting(E_ALL);
require_once 'vendor/autoload.php';
use Plivo\RestAPI;
$to = $_POST['To'];
$from = $_POST['From'];
$text = $_POST['Text'];
echo "<br/>Sent Message info:<br/><br/>To: $to<br/>";
echo "From: $from <br/>";
echo "Message: $text <br/>";
$auth_id = 'Auth id';
$auth_token = "Token";
$p = new RestAPI($auth_id, $auth_token);
print_r($p);
// Send a message
$params = array(
'src' => "$from",
'dst' => "$to",
'text' => "$text",
'type' => 'sms',
);
$response = $p->send_message($params);
echo $response[0];
if (array_shift(array_values($response)) == "202")
{
echo "<br/><br/>Message status: Sent";
}
else
{
echo "<br/><br/>Error: Please ensure that From number is a valid";
}