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

SmsClient.SendAsync 方法

定义

重载

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

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

SendAsync(String, String, String, SmsSendOptions, CancellationToken)

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

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

Source:
SmsClient.cs
Source:
SmsClient.cs

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

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

适用于

SendAsync(String, String, String, SmsSendOptions, CancellationToken)

Source:
SmsClient.cs
Source:
SmsClient.cs

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

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

参数

from
String

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

to
String

收件人的电话号码。

message
String

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

options
SmsSendOptions

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

cancellationToken
CancellationToken

任务的取消标记。

返回

例外

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

message 为 null。

适用于