Doc AWS SDK 예제 GitHub 리포지토리에서 더 많은 SDK 예제를 사용할 수 있습니다. AWS
기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.
Hello Amazon SES API v2
다음 코드 예제에서는 Amazon SES API v2 사용을 시작하는 방법을 보여줍니다.
- Python
-
- SDK for Python(Boto3)
-
참고
GitHub에 더 많은 내용이 있습니다. AWS 코드 예 리포지토리
에서 전체 예를 찾고 설정 및 실행하는 방법을 배워보세요. def hello_sesv2(sesv2_client): """ Use the AWS SDK for Python (Boto3) to create an Amazon SESv2 client and list the email identities in your account. This example uses the default settings specified in your shared credentials and config files. :param sesv2_client: A Boto3 SESv2 client object. """ print("Hello, Amazon SESv2. Let's list up to 5 email identities:\n") try: response = sesv2_client.list_email_identities(PageSize=5) identities = response["EmailIdentities"] if not identities: print( "No email identities found. " "Use CreateEmailIdentity to add one." ) else: for identity in identities: print( f" Identity: {identity['IdentityName']}" f" Type: {identity['IdentityType']}" f" Status: {identity['VerificationStatus']}" f" Sending: {'Enabled' if identity['SendingEnabled'] else 'Disabled'}" ) print(f"\nShowing {len(identities)} email identity(ies).") except ClientError as err: logger.error( "Couldn't list email identities. Here's why: %s: %s", err.response["Error"]["Code"], err.response["Error"]["Message"], ) raise-
API 세부 정보는 SDK for Python (Boto3) API 참조의 ListEmailIdentities를 참조하세요. AWS
-
기본 사항
작업