AWS Cognito无法发送用户邮箱验证邮件问题排查求助
Troubleshooting AWS Cognito Verification Email Not Sending
Let’s walk through the most likely issues that could be preventing your verification emails from firing after sign-up, based on your setup and code:
1. Check Cognito User Pool Verification & Confirmation Settings
This is the most common culprit. Head to your AWS Cognito User Pool console and verify these settings:
- MFA and verifications > Email verification: Ensure this is set to Enabled and triggered Upon sign-up. If it’s disabled or set to another trigger, no email will send.
- Attribute verification and user account confirmation:
- Make sure Verification type is set to Email.
- Double-check that Auto-confirm users is NOT checked (unless you have a custom confirmation flow that handles verification outside of email). If this is enabled, users are marked as confirmed immediately upon sign-up, so no verification email is sent.
- Message customizations > Email: Confirm the From address uses an email/domain that’s verified in AWS SES (Simple Email Service), and that SES is in the same region as your Cognito user pool. Mismatched regions or unverified senders will block email delivery.
2. Verify Amplify Configuration
Ensure your Amplify setup is properly connected to Cognito:
- Confirm your
aws-exports.jsfile has the correctuserPoolId,userPoolWebClientId, andregionvalues matching your Cognito user pool. - Make sure you’re calling
Amplify.configure(awsExports);early in your app’s initialization (e.g., inApp.jsbefore rendering the Authenticator component). Missing this can lead to unexpected behavior in the sign-up flow.
3. Validate Your Custom Sign-Up Form Fields
Looking at your code, you’re extending the default SignUp FormFields with custom attributes—here are a few things to check:
- Ensure the custom field names (like
custom:business_name,custom:type) exactly match the attribute names defined in your Cognito user pool. A typo here could cause silent failures in the sign-up flow, though you mentioned users are being created, so this is less likely. - Try testing with the default SignUp form (remove your custom
components={{ SignUp: { FormFields() {...} } }}block temporarily). If the verification email sends with the default form, the issue might be in how you’re extending the form fields (e.g., missing required validation for a Cognito-mandatory attribute). - Check if any
validationErrorsare being thrown during sign-up—you could add a section like{Object.values(validationErrors).map(err => <p style={{color: 'red'}}>{err}</p>)}to catch any hidden issues that aren’t being displayed.
4. Check SES Quotas & Email Deliverability
- Verify your AWS SES account has enough sending quota to send verification emails. If you’re in the SES sandbox, you’ll need to verify both the sender and recipient emails, and you have a low daily send limit.
- Ask your users to check their spam/junk folders—sometimes verification emails get routed there, even if you’re using a verified domain.
Quick Test to Isolate the Issue
To narrow things down:
- Create a test user directly via the Cognito console (Users and groups > Create user). If no verification email sends, the issue is definitely in your Cognito/SES setup, not your code.
- If the console-created user gets an email, then the problem lies in how your Amplify Authenticator is handling the sign-up flow (go back to checking Amplify config and custom form fields).
内容的提问来源于stack exchange,提问作者Bsubs02
相关产品推荐
相关产品推荐

