Issue with Sending emails using SES: Timeout

System Information
  • Strapi Version: 3.4.5
  • Operating System: Macos
  • Database: SQL lite
  • Node Version: v14.15.0
  • NPM Version: 6.14.11
  • Yarn Version: 1.22.10

Hi everyone,
anyone working with AWS SES for sending emails.
I have put all the configuration but, I always endup with :
[2021-02-03T11:02:50.296Z] debug :tv:: Error: connect ETIMEDOUT 35.158.187.131:443
[2021-02-03T11:02:50.297Z] debug :tv:: {}
This on local dev.
I used the same settings with nodemailer on an express project without issues.

   email: {
  provider: 'amazon-ses',
  providerOptions: {
    key: 'XXXXXXX',
    secret: 'XXXXXXXXXXXXXXXXXXXXXX',
    amazon: 'https://email-smtp.eu-central-1.amazonaws.com',
  },

module.exports = {

/**

  • Sends an email to the recipient in the body of the request
    */
    send: async (ctx) => {
    const body = ctx.request.body
    const sendTo = body.email
    strapi.log.debug(Trying to send an email to ${sendTo})
    const templateId = “1”,
    to = sendTo,
    from = “contact@xxxx.com”,
    replyTo = “contact@xxxx.com”,
    subject = “[TEST] This is a test using strapi-email-designer”,
    userData = {
    email: sendTo,
    };
    try {
    await strapi.plugins[“email-designer”].services.email.send({
    templateId,
    to,
    from,
    replyTo,
    subject,
    data: userData,
    });
    } catch (err) {
    strapi.log.debug(":tv:: ", err);
    return ctx.badRequest(null, err);
    }
    },
    }

Thanks for the Help


The error message you’re encountering, “connect ETIMEDOUT 35.158.187.131:443”, indicates that your local development environment is unable to establish a connection with the SES endpoint at https://email-smtp.eu-central-1.amazonaws.com .

Configure the AWS CLI with your credentials using aws configure.

Try running aws ses list-identities from your terminal. If this works, it suggests the issue might be specific to your local development setup.

If you’re using an EC2 instance for local development, ensure the security group allows outbound traffic on port 443 to the SES endpoint in the EU Central-1 (eu-central-1) region.

Double-check your Nodemailer configuration, especially the amazon property. It should point to the correct SES endpoint for your region:

  • https://email-smtp.eu-central-1.amazonaws.com for EU Central-1
  • Use the appropriate endpoint URL for your region if it’s different.

I am also having the same issue, it works fine using send-email cli command but does not work using local strapi.

The region / amazon property is correct, IAM credentials are also valid.

But still having the same error connect ETIMEDOUT