我正在使用 ASW Lambda 毫無問題地向 AWS SES 中的已驗證身份發送電子郵件。現在我只是想列出經過驗證的身份而沒有得到任何回應。
這是我的代碼:
import boto3
from botocore.exceptions import ClientError
def list_identities():
ses = boto3.client('ses')
response = ses.list_identities(
IdentityType = 'EmailAddress',
MaxItems=10
)
def lambda_handler(event, context):
# TODO implement
print("Listing EMAILS:")
list_identities()
在功能日志中,我看到列印的串列電子郵件:僅此而已。Lambda 函式在與 AWS SES 相同的區域中呼叫。
uj5u.com熱心網友回復:
你不會從你的函式中回傳任何東西。
嘗試這個:
import boto3
def list_identities():
ses = boto3.client('ses')
response = ses.list_identities(
IdentityType='EmailAddress',
MaxItems=10
)
return response
def lambda_handler(event, context):
# TODO implement
print("Listing EMAILS:")
print(list_identities())
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/517186.html
