我正在使用..
从AWS lambda发送邮件const params = {
Destination: {
ToAddresses: ["xxx@xxx.com"]
},
Header : {
"Reply-To" : "hello@gmail.com"
},
Message: {
Body: {
Html: {
Charset: "UTF-8",
Data: htmlBody
},
Text: {
Charset: "UTF-8",
Data: textBody
}
},
Subject: {
Charset: "UTF-8",
Data: "My title"
}
},
Source: "xxx.com"
};
// Create the promise and SES service object
const sendPromise = new AWS.SES({ apiVersion: "2010-12-01",region: 'us-east-1' })
.sendEmail(params)
.promise();
但是,它给予UnexpectedParameter: Unexpected key 'Headers' found in params
如何使用SES&正确发送标头;Lambda,我需要主要使用reply-to
。
SES sendEmail
功能参数没有Header
密钥。我相信您正在寻找称为ReplyToAddresses
的密钥,这是电子邮件地址的列表。
因此您可以替换
Header : {
"Reply-To" : "hello@gmail.com"
},
在您的代码中
ReplyToAddresses: [ "hello@gmail.com" ]