var capabilities = new PhoneNumberCapabilities(sms:PhoneNumberCapabilityType.Outbound);
// ... register the phone number and use it in the following code:
SmsSendResult sendResult = smsClient.Send(
from: "<from-phone-number>",
to: "<to-phone-number>",
message: "Hello World via SMS"
);
2条答案
按热度按时间qxgroojn1#
确保将
<from-phone-number>
设置为您之前使用电话号码功能sms:PhoneNumberCapabilityType.Outbound
注册的电话号码。字符串
00jrzges2#
请确保您使用的是付费订阅,而不是试用版,因为它不支持发送短信.我花了一整天跟踪这个花絮下来:
https://learn.microsoft.com/en-us/answers/questions/489986/azure-communication-service-cant-create-number