可以使用AWS SES SDK获取有关电子邮件状态的信息。以下是一个使用AWS SDK for JavaScript的示例代码:
const AWS = require('aws-sdk');
AWS.config.update({ region: 'us-west-2' });
const ses = new AWS.SES();
const params = {
// Specify a unique identifier for the email that you're requesting the status for
// This should be the MessageId that was returned when the email was sent
// Example: '0123456789abcdef0123456789abcdef0123456789abcdef000000001234567890'
MessageId: '0123456789abcdef0123456789abcdef0123456789abcdef000000001234567890',
};
ses.getSendEmailQuota(params, (err, data) => {
if (err) console.log(err, err.stack);
else console.log(data);
});
其中,MessageId
参数代表邮件的唯一标识符,它应该是在发送邮件时返回的MessageId
。ses.getSendEmailQuota()
方法返回一个包含有关邮件状态的信息对象,可以通过data
参数访问。具体可查看AWS SES官方文档。