问题描述
我购买了一个美国号码,我正在尝试向香港发送可编程消息.虽然我发送了一个简单的 Twilio 号码,但它工作正常并且收到了消息.
I had purchased a USA number and I am trying to send a programable message to Hong Kong. While I send with a simple Twilio number it works fine and message recieved.
但是当我尝试添加字母数字发件人 ID 时,它总是显示错误消息.错误消息是:Message: [HTTP 400] Unable to create record: The 'From' number infoSMS is not a valid phone number, shortcode, or alphanumeric sender ID.
But when I try to add alphanumeric Sender ID it always show error message. The error message is: Message: [HTTP 400] Unable to create record: The 'From' number infoSMS is not a valid phone number, shortcode, or alphanumeric sender ID.
我试过的是
public function send_sms(){
$msg_to = $_REQUEST['msg_to'];
$msg_body = $_REQUEST['msg_body'];
$twilio = new Client("ACba7f3a6866a23aed021056d3ceaexxxx", "4d7e47e92a8351b7365ed1e3e83dxxxx");
$message = $twilio->messages->create(
$msg_to, // to
[
"body" => $msg_body,
"from" => "infoSMS";
]
);
if($message->sid) {
$this->session->set_flashdata('ok_message', '- SMS successfully sent!');
redirect(AURL . 'Sms/sent_sms_list');
}else {
$this->session->set_flashdata('err_message', '- Error in sending sms please try again!');
redirect(SURL . 'Sms/create_sms');
}
}
我已阅读文档:https://www.twilio.com/docs/sms/send-messages#use-an-alphanumeric-sender-id
我做错了什么?提前致谢.
What I am doing wrong? Thanks in advance.
推荐答案
Twilio 开发人员布道者在这里.
Twilio developer evangelist here.
这有点难以追踪,但事实证明,有一些通用的字母数字发件人 ID 可能会导致递送失败.我尝试使用infoSMS"发送短信.作为发件人 ID,也无法这样做.
This was a bit hard to track down, but it turns out that there are a few generic alphanumeric sender IDs that may cause delivery failures. I tried to send an SMS using "infoSMS" as the sender ID and was unable to do so as well.
在我们的一些短信指南页面上,有关于字母数字发件人的说明ID:
On some of our SMS guideline pages, there is this note about alphanumeric sender IDs:
应避免使用 InfoSMS、INFO、Verify、Notify 等通用 Alpha 发件人 ID,因为它们会导致 SMS 失败
我建议您尝试使用更能代表您的业务或服务的其他字母数字发件人 ID.
I recommend you try using a different alphanumeric sender ID that more closely represents your business or service.
这篇关于在添加字母数字发件人 ID 时,我总是在 php 中出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!