Ongoing service disruptions
For the most recent update on ongoing service disruptions affecting the AWS Middle East (UAE) Region (ME-CENTRAL-1), refer to the AWS Health Dashboard. For information on AWS Service migration, see How do I migrate my services to another region?
如何將 Amazon SES 與 Amazon Cognito 使用者集區整合?
我想將 Amazon Simple Email Service (Amazon SES) 與 Amazon Cognito 使用者集區整合。
解決方法
**注意:**如果您在執行 AWS Command Line Interface (AWS CLI) 命令時收到錯誤訊息,請參閱對 AWS CLI 錯誤進行疑難排解。此外,請確定您使用的是最新的 AWS CLI 版本。
先決條件:
不支援 Amazon Cognito 和 Amazon SES 的跨帳戶整合。您無法在一個帳戶中設定 Amazon Cognito 使用者集區,然後將其與另一個帳戶中的 Amazon SES 電子郵件地址整合。
檢查 Amazon SES 沙盒限制
所有新的 Amazon SES 帳戶都放置在 Amazon SES 沙盒中,以防止詐欺和濫用。使用 Amazon SES 沙盒時,請檢查限制。
將您的帳戶移出 Amazon SES 沙盒
如果您尚未從 Amazon SES 沙盒中移除您的帳戶,請完成以下步驟:
- 查看 Amazon SES 電子郵件組態中的 AWS 區域對應表。
對應表顯示了 Amazon SES 身分可以與 Amazon Cognito 使用者集區整合的區域。在將 Amazon SES 帳戶移出沙盒之前,請確保使用相容的區域。 - 為您的 Amazon SES 帳戶請求生產存取權。AWS Support 團隊將在 24 小時內對您的請求提供初步回應。
生產存取請求獲得核准後,您可以向任何收件者傳送電子郵件訊息。
**注意:**您必須切換到新的 Amazon Cognito 主機體驗,才能將 Amazon Cognito 與同一區域中的 Amazon SES 整合。
確認您的 Amazon SES 網域身分
在 Amazon SES 中確認一個或多個網域身分。如果您需要在驗證之前建立網域身分,請參閱建立網域身分。
確認您的 Amazon SES 電子郵件身分
在 Amazon SES 中確認一個或多個電子郵件地址。如果您需要在驗證之前建立電子郵件地址身分,請參閱建立電子郵件地址身分。
將您的使用者集區與已驗證的身分整合
如果已驗證 Amazon SES 網域身分,請完成以下步驟:
- 登入 Amazon Cognito 主控台,然後選擇 User Pools (使用者集區)。
- 選取使用者集區。
- 在 Authentication methods (驗證方法) 功能表中,選取 Email configuration (電子郵件組態)。然後,選擇 Edit (編輯)。
- 在 FROM email address (寄件者電子郵件地址) 下,選擇 Amazon SES 驗證的網域身分。例如,example.com。
- 在 FROM sender name (寄件者名稱) 下,輸入您的電子郵件地址。例如,admin@example.com。
您可以為網域身分新增自訂電子郵件地址。UpdateUserPool API 會使用 Amazon SES 身分設定 Amazon Cognito 使用者集區。
update-user-pool 命令範例:
$ aws cognito-idp update-user-pool --user-pool-id example_pool_id --email-configuration SourceArn=arn:aws:ses:example_region:example_account_number:identity/example_domain,EmailSendingAccount=DEVELOPER,From=user@example.com --region example_region
**重要:**UpdateUserPool API 會重設使用者集區的現有組態。首先,調用 DescribeUserPool API,然後將所有現有使用者集區參數傳送到 UpdateUserPool API。
以下是 update-user-pool 命令的說明:
- example_pool_id 對應至 Amazon Cognito 使用者集區 ID。例如:ap-southeast-1_xxxxxxxx。
- arn:aws:ses:example_region:example_account_number:identity/example_domain 是您 Amazon SES 網域身分的 Amazon Resource Name (ARN)。
- 必須將 user@example.com 替換為您的電子郵件身分。
- example_region 表示您的 Amazon Cognito 使用者集區所在的區域。例如:ap-southeast-1。
如果已驗證 Amazon SES 電子郵件身分,請完成以下步驟:
- 登入 Amazon Cognito 主控台,然後選擇 User Pools (使用者集區)。
- 選取使用者集區。
- 在 Authentication methods (驗證方法) 功能表中,選取 Email configuration (電子郵件組態)。然後,選擇 Edit (編輯)。
- 在 FROM email address (寄件者電子郵件地址) 下,選擇 Amazon SES 電子郵件網域身分。例如,admin@example.com。
錯誤疑難排解
解決未經驗證的電子郵件地址錯誤
您可能會收到錯誤:"Email address is not verified. The following identities failed the check in region AP-SOUTHEAST-1: user@example.com."
如果您收到此錯誤,表示您嘗試從 Amazon SES 沙盒帳戶向未經驗證的電子郵件地址傳送電子郵件。
若要解決此錯誤,請將您的 Amazon SES 帳戶移出沙盒,或在 Amazon SES 中確認收件者的電子郵件地址。
電子郵件遺失
如果使用者沒有收到您 Amazon Cognito 使用者集區的電子郵件,請完成以下步驟:
-
確認您使用 Amazon Cognito 預設電子郵件組態或 Amazon SES 電子郵件組態來傳送電子郵件。
-
透過 AWS 管理主控台確認您的更新。或者,執行 DescribeUserPool API。
describe-user-pool 命令範例:aws cognito-idp describe-user-pool --user-pool-id example_pool_id --region example_region --query 'UserPool.EmailConfiguration'您可能會收到以下其中一個輸出:
{ "SourceArn": "arn:aws:ses:us-east-1:123456789012:identity/admin@example.com", "EmailSendingAccount": "DEVELOPER", "From": "admin@example.com" }或者
{ "SourceArn": "arn:aws:ses:us-east-1:123456789012:identity/admin@example.com", "EmailSendingAccount": "COGNITO_DEFAULT" }如果 EmailSendingAccount 為 DEVELOPER,則表示您的使用者集區正在使用 Amazon SES。檢查您的 Amazon SES 帳戶是否在沙盒中。如果在沙盒中,請將其移出沙盒,以向未經驗證的身分傳送電子郵件。如果帳戶已退出沙盒,請檢查 Amazon SES 日誌是否有電子郵件傳遞問題。
如果 EmailSendingAccount 為 COGNITO_DEFAULT,則表示您的使用者群組正在使用 Amazon Cognito 的預設電子郵件功能。此功能對每個使用者集區傳送的電子郵件數量設有配額。
解決每日電子郵件配額錯誤
您可能會收到錯誤:"Exceeded daily email limit for the operation or account. Number of allowed operation has exceeded. If a higher limit is required, please configure your user pool to use your own Amazon SES configuration for sending email messages."
如果您收到此錯誤,則表示您超出了 Amazon Cognito 預設電子郵件組態的配額。
若要解決此問題,請將您的使用者集區設定為使用您自己的 Amazon SES 組態來傳送電子郵件。這會增加您的 Amazon SES 傳送配額。
相關資訊
- 語言
- 中文 (繁體)

相關內容
- 已提問 3 年前
- 已提問 3 年前