Created
May 5, 2021 21:31
-
-
Save JackCloudman/3786640b718d83d0e5ac5898c552ad64 to your computer and use it in GitHub Desktop.
Get Available Emails with AWS SES Boto3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import boto3 | |
| # Create SES client | |
| ses = boto3.client('ses') | |
| emails = ses.list_identities( | |
| IdentityType = 'EmailAddress', | |
| MaxItems=10 #max Items | |
| )["Identities"] | |
| response = ses.get_identity_verification_attributes( | |
| Identities=emails | |
| ) | |
| # FILTER ONLY SUCCESS VALIDATIONS EMAILS | |
| available_emails = [r for r in response["VerificationAttributes"] if response["VerificationAttributes"][r]["VerificationStatus"] == "Success"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment