0
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)
                }
            }
        }
    )

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/\

For Lambda function my region is ap-southeast-1

Any Help will be appriciated

2
  • what is in your config file at ~/.aws/config ? Commented Jun 5, 2018 at 5:59
  • @Prany I was not using ~/.aws/config. I was writing code into live console Commented Jun 5, 2018 at 6:08

3 Answers 3

4

At the time of writing this, AWS offers its SES service only for 6 regions:

  • US East (N. Virginia) us-east-1
  • US West (Oregon) us-west-2
  • EU (Ireland) eu-west-1
  • AP (Mumbai) ap-south-1
  • AP (Sydney) ap-southeast-2
  • EU (Frankfurt) eu-central-1

Use one of the above as your AWS_REGION

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

Note: Look for the latest list of regions on AWS website.

Sign up to request clarification or add additional context in comments.

Comments

0

Problem is solved by a hardcode region string 'us-east-1'

Now I am creating the client as:

boto3.client('ses', 'us-east-1')

I think this was due to the unavailability of SES in Singapore region.

Comments

0

You can always check the status of AWS services and their availability in different regions before using at https://status.aws.amazon.com/.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.