var credentials = {
accessKeyId: "AMAZON accessKeyId",
secretAccessKey: "secretAccessKey accessKey"
};
AWS.config.update(credentials);
AWS.config.region = 'ap-southeast-1';
var sesv2 = new AWS.SESV2();
var params = {
Content: {
Simple: {
Body: {
Html: {
Data: '邮件内容',
Charset: 'UTF-8'
}
},
Subject: {
Data: '邮件主题',
Charset: 'UTF-8'
}
}
},
Destination: { ToAddresses: ['xxxx 收件人 [email protected]'] },
FromEmailAddress: '发件人 xxxx',
FromEmailAddressIdentityArn: '发件人 ARN',
};
sesv2.sendEmail(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});