我正在使用Twilio PHP API向我的客戶發送大量短信。
問題是,我只能像發送短信80st,然後我得到了一個服務器錯誤:503嘗試使用Twilio發送短信時出錯
Failed to load resource: the server responded with a status of 503 (Backend fetch failed)
嗯,我想這可能是錯誤。
因爲我沒有成功回聲echo "Sent message to $name
和twilio短信日誌,我只能看到80發送了200條短信。
什麼會導致此錯誤?
foreach ($usrs as $number => $name) {
try{
$sms = $client->account->messages->create(
// the number we are sending to - Any phone number
$number,
array(
// Step 6: Change the 'From' number below to be a valid Twilio number
'from' => "xxxxxxxxxxx",
// the sms body
'body' => "Hey $name. $text"
)
);
// Display a confirmation message on the screen
echo "Sent message to $name <br>";
}
catch (TwilioException $e) {
die($e->getCode() . ' : ' . $e->getMessage());
}
}
我認爲它是因爲你可以每秒發送特定的消息。 延遲了一些短信和[檢查鏈接](https://support.twilio.com/hc/en-us/articles/115002943027-Understanding-Twilio-Rate-Limits-and-Message-Queues) –