TypeError in using SendBulkEmail

0

Hello,

I'm a new AWS SES trying to create a notification tool for a startup.

I'm still in the sandbox node but I'm trying to use the SendBulkEmail API to send messages to verified email addresses. However, when I call the sendBulkEmail function, it gives me the error

TypeError: (intermediate value).sendBulkEmail is not a function

Here's my code:

import * as AWS from '@aws-sdk/client-ses';

/******* Parameter Object *****************/ // Create sendEmail params var params = { BulkEmailEntries: [ { Destination: { BccAddresses: "abc@gmail.com", CcAddresses: "abc@gmail.com", ToAddresses: [ 'xyz@gmail.com', 'random@gmail.com', 'random2@gmail.com', 'random3@gmail.com', 'random4@gmai.com' ] } } ], "DefaultContent": "Hey everyone, I'm testing the bulk email function", FromEmailAddress: "sender@gmail.com",

ReplyToAddresses: [ "reply@gmail.com" ]

};

// Create the promise and SES service object var sendPromise = new AWS.SES({apiVersion: '2010-12-01'}).sendBulkEmail(params).promise();

// Handle promise's fulfilled/rejected states sendPromise.then( function(data) { console.log(data.MessageId); }).catch( function(err) { console.error(err, err.stack); });

Thank you very much!!!!

Keine Antworten

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen