Skip to content

Instantly share code, notes, and snippets.

@JackCloudman
Created May 5, 2021 21:31
Show Gist options
  • Select an option

  • Save JackCloudman/3786640b718d83d0e5ac5898c552ad64 to your computer and use it in GitHub Desktop.

Select an option

Save JackCloudman/3786640b718d83d0e5ac5898c552ad64 to your computer and use it in GitHub Desktop.
Get Available Emails with AWS SES Boto3
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