Saturday, 20 October 2018

Node.Js AWS SES - ETIMEDOUT when sending Email

I want to send a verification Email to new people signing up via AWS SES in Node.js:

var params = {
    Destination: {
        ToAddresses: [
            '...',
        ]
    },
    Message: {
        Body: {
            Html: {
                Data: '...',
                Charset: 'utf-8'
            },
            Text: {
                Data: '...',
                Charset: 'utf-8'
            }
        },
        Subject: {
            Data: '...',
            Charset: 'utf-8'
        }
    },
    Source: '...',
    ReturnPath: '...',
};
const ses = new AWS.SES({
    my_accessKeyId,
    my_secretAccessKey,
    my_region,
})
ses.sendEmail(params, function (err, data) {
    // ...
});

Unfortunately, nothing happens and after a minute or so I get the following error:

{ Error: connect ETIMEDOUT 35.157.44.176:443
    at Object._errnoException (util.js:992:11)
    at _exceptionWithHostPort (util.js:1014:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1186:14)
  message: 'connect ETIMEDOUT 35.157.44.176:443',
  code: 'NetworkingError',
  errno: 'ETIMEDOUT',
  syscall: 'connect',
  address: '35.157.44.176',
  port: 443,
  region: 'eu-central-1',
  hostname: 'email.eu-central-1.amazonaws.com',
  retryable: true,
  time: 2018-10-18T16:52:00.803Z }

I am not sure if the error results from a mistake in my code, as I am currently only using the sandbox environment. But I verified the sending and receiving email, which should work fine even in sandbox mode.


P.S. I am not quite sure how to properly test my application when being in sandbox mode, as I am not allowed to send to unverified emails. Is it possible to request production access without a proper application running?



from Node.Js AWS SES - ETIMEDOUT when sending Email

No comments:

Post a Comment