首页 > 解决方案 > Nodemailer SES TRANSPORT 错误:“UnexpectedParameter:在参数中找到意外的键 'Destination'”

问题描述

使用来自 Nodemailer 的 SES TRANSPORT 发送 AWS SES 模板化电子邮件时面临问题。

SES TRANSPORT Documentation中,它说

To use SES transport, set a aws.SES object as the value for SES property in Nodemailer transport options.

这是我的代码的外观。

transporter.sendMail({
  ses: { 
          Destination: {
          CcAddresses: [], 
          ToAddresses: 'recipient@example.com'
        },
        Source: 'sender@example.com' ,
        Template: 'template_name' ,
        TemplateData: JSON.stringify(data) ,
        // optional extra arguments for SendRawEmail
        Tags: [{
            Name: 'tag name',
            Value: 'tag value'
        }]
  }
}, (err, info) => {
    console.log(info.envelope);
    console.log(info.messageId);
});

这是我得到的错误。

2019-08-12T17:03:38.210Z error: There were 3 validation errors:
* UnexpectedParameter: Unexpected key 'Destination' found in params
* UnexpectedParameter: Unexpected key 'Template' found in params
* UnexpectedParameter: Unexpected key 'TemplateData' found in params

标签: amazon-sesnodemailer

解决方案


推荐阅读