你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

SmsClient.Send 方法

定义

重载

Send(String, IEnumerable<String>, String, SmsSendOptions, CancellationToken)

从属于经过身份验证的帐户的电话号码发送短信。

Send(String, String, String, SmsSendOptions, CancellationToken)

向短信 from 发送经过身份验证的帐户获取的电话号码( to 另一个电话号码)。

Send(String, IEnumerable<String>, String, SmsSendOptions, CancellationToken)

Source:
SmsClient.cs
Source:
SmsClient.cs

从属于经过身份验证的帐户的电话号码发送短信。

public virtual Azure.Response<System.Collections.Generic.IReadOnlyList<Azure.Communication.Sms.SmsSendResult>> Send (string from, System.Collections.Generic.IEnumerable<string> to, string message, Azure.Communication.Sms.SmsSendOptions options = default, System.Threading.CancellationToken cancellationToken = default);
abstract member Send : string * seq<string> * string * Azure.Communication.Sms.SmsSendOptions * System.Threading.CancellationToken -> Azure.Response<System.Collections.Generic.IReadOnlyList<Azure.Communication.Sms.SmsSendResult>>
override this.Send : string * seq<string> * string * Azure.Communication.Sms.SmsSendOptions * System.Threading.CancellationToken -> Azure.Response<System.Collections.Generic.IReadOnlyList<Azure.Communication.Sms.SmsSendResult>>
Public Overridable Function Send (from As String, to As IEnumerable(Of String), message As String, Optional options As SmsSendOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Response(Of IReadOnlyList(Of SmsSendResult))

参数

from
String

发件人的电话号码,采用 E.164 格式,由经过身份验证的帐户拥有。

to
IEnumerable<String>

收件人的电话号码,采用 E.164 格式。 在此版本中,列表中最多支持 100 个收件人。

message
String

将发送给收件人的邮件的内容。 允许的内容由 RFC 5724 定义。

options
SmsSendOptions

用于发送短信的可选配置。

cancellationToken
CancellationToken

要使用的取消标记。

返回

例外

服务器返回了错误。 有关从服务器返回的详细信息,请参阅 Message

message 为 null。

适用于

Send(String, String, String, SmsSendOptions, CancellationToken)

Source:
SmsClient.cs
Source:
SmsClient.cs

向短信 from 发送经过身份验证的帐户获取的电话号码( to 另一个电话号码)。

public virtual Azure.Response<Azure.Communication.Sms.SmsSendResult> Send (string from, string to, string message, Azure.Communication.Sms.SmsSendOptions options = default, System.Threading.CancellationToken cancellationToken = default);
abstract member Send : string * string * string * Azure.Communication.Sms.SmsSendOptions * System.Threading.CancellationToken -> Azure.Response<Azure.Communication.Sms.SmsSendResult>
override this.Send : string * string * string * Azure.Communication.Sms.SmsSendOptions * System.Threading.CancellationToken -> Azure.Response<Azure.Communication.Sms.SmsSendResult>
Public Overridable Function Send (from As String, to As String, message As String, Optional options As SmsSendOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Response(Of SmsSendResult)

参数

from
String

发件人的电话号码,该电话号码由经过身份验证的帐户拥有。

to
String

收件人的电话号码。

message
String

将发送给收件人的邮件的内容。 允许的内容由 RFC 5724 定义。 如果消息超过 160 个字符,服务器会自动将其拆分为多个 SMS。

options
SmsSendOptions

用于发送短信的可选配置。

cancellationToken
CancellationToken

基础请求的取消标记。

返回

例外

服务器返回了错误。 有关从服务器返回的详细信息,请参阅 Message

message 为 null。

适用于