通过python lambda函数使用boto3的AWS SES电子邮件 [英] AWS SES Email using boto3 through python lambda function

查看:157
本文介绍了通过python lambda函数使用boto3的AWS SES电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

boto3.client('ses').send_email(
        Source = email_from,
        Destination={
            'ToAddresses': [
                email_to,
            ]
        },
        Message={
            'Subject': {
                'Data': emaiL_subject
            },
            'Body': {
                'Text': {
                    'Data': email_body.format(user_password)
                }
            }
        }
    )

我正在使用boto3 SES,通过lambda函数执行上述代码后,出现以下错误:

I am using boto3 SES, after execution of the above code through lambda function I am getting the following error:

Could not connect to the endpoint URL: \"https://email.ap-southeast-1.amazonaws.com/\

对于Lambda函数,我的区域是 ap-southeast-1

For Lambda function my region is ap-southeast-1

任何帮助都将被申请

推荐答案

AWS当前仅在3个地区提供其SES服务:

AWS currently offer its SES service only for 3 regions:

  • 美国东部(弗吉尼亚北部) us-east-1
  • 美国西部(俄勒冈州) us-west-2
  • 欧盟(爱尔兰) eu-west-1

使用上述方法之一作为您的 AWS_REGION

Use one of the above as your AWS_REGION

client = boto3.client('ses',region_name=AWS_REGION)

这篇关于通过python lambda函数使用boto3的AWS SES电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆