Title: How to resolve error when executing node module with AWS SES config
Tags: node-modules;amazon-ses
Question: Getting below error while running module with AWS SES config. Please help. The below lines contain error that is occurring and the actual code itself. I have added the verified email in console and used the same in the node module.
node --unhandled-rejections=strict ses_sendemail.js
node:internal/process/promises:227
triggerUncaughtException(err, true /* fromPromise */);
^
Error: read drussell@example.net (node:internal/stream_base_commons:220:20) {
errno: -4077,
code: 'TimeoutError',
syscall: 'read',
time: 2022-01-16T23:49:04.829Z,
region: 'ap-southeast-2',
hostname: 'email.ap-southeast-2.amazonaws.com',
retryable: true
// import AWS SDK
const AWS = require('aws-sdk');
// Amazon SES configuration
const SESConfig = {
apiVersion: '2010-12-01',
accessKeyId: '',
secretAccessKey: '',
region: ''
var params = {
Source: '',
Destination: {
ToAddresses: [
''
ReplyToAddresses: [
'',
Message: {
Body: {
Html: {
Charset: &quot;UTF-8&quot;,
Data: 'IT IS <strong&gt;WORKING</strong&gt;!'
}
},
Subject: {
Charset: 'UTF-8',
Data: 'Node + SES Example'
new AWS.SES(SESConfig).sendEmail(params).promise().then((res) =&gt; {
console.log(res);



{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 0, 'CommentCount': 0, 'ContentLicense': 'CC BY-SA 4.0', 'CreationDate': '2022:00:01/17/22', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<node-modules><amazon-ses>', 'Title': 'How to resolve error when executing node module with AWS SES config', 'ViewCount': 93, 'id': 70735219, 'user_AboutMe': None, 'user_AccountId': 23960046.0, 'user_DisplayName': 'user17950266', 'user_Reputation': 1.0, 'user_Views': 0.0, 'user_id': 17950266.0}}