AWS 文档 SDK 示例
将 GetSendQuota 与 AWS SDK 或 CLI 配合使用
以下代码示例演示如何使用 GetSendQuota。
- .NET
-
- 适用于 .NET 的 SDK
-
注意
查看 GitHub,了解更多信息。在 AWS 代码示例存储库
中查找完整示例,了解如何进行设置和运行。 /// <summary> /// Get information on the current account's send quota. /// </summary> /// <returns>The send quota response data.</returns> public async Task<GetSendQuotaResponse> GetSendQuotaAsync() { var result = new GetSendQuotaResponse(); try { var response = await _amazonSimpleEmailService.GetSendQuotaAsync( new GetSendQuotaRequest()); result = response; } catch (Exception ex) { Console.WriteLine("GetSendQuotaAsync failed with exception: " + ex.Message); } return result; }-
有关 API 详细信息,请参阅《适用于 .NET 的 AWS SDK API Reference》中的 GetSendQuota。
-
- CLI
-
- AWS CLI
-
获取 Amazon SES 发送限制
以下示例使用
get-send-quota命令返回 Amazon SES 发送限制:aws ses get-send-quota输出:
{ "Max24HourSend": 200.0, "SentLast24Hours": 1.0, "MaxSendRate": 1.0 }Max24HourSend 是发送配额,即,您在 24 小时之内可发送的最大电子邮件数量。发送配额反映一个滚动的时段。每当您尝试发送电子邮件时,Amazon SES 都会检查您在过去 24 小时内发送的电子邮件数量。只要您发送电子邮件总数小于您的配额,发送请求就会被接受,并发送您的电子邮件。
SentLast24Hours 是您在过去 24 小时内已发送的电子邮件数量。
MaxSendRate 是您每秒最多可发送的电子邮件数量。
请注意,发送限制基于收件人而不是消息。例如,一封包含 10 个收件人的电子邮件占用 10 份发送配额。
有关更多信息,请参阅《Amazon Simple Email Service 开发人员指南》中的“管理您的 Amazon SES 发送限制”。
-
有关 API 详细信息,请参阅《AWS CLI Command Reference》中的 GetSendQuota
。
-
- PowerShell
-
- Tools for PowerShell V4
-
示例 1:此命令返回用户的当前发送限制。
Get-SESSendQuota-
有关 API 详细信息,请参阅《AWS Tools for PowerShell Cmdlet Reference (V4)》中的 GetSendQuota。
-
- Tools for PowerShell V5
-
示例 1:此命令返回用户的当前发送限制。
Get-SESSendQuota-
有关 API 详细信息,请参阅《AWS Tools for PowerShell Cmdlet Reference (V5)》中的 GetSendQuota。
-