我'm running a notification node express backend service via AWS Lambda to send emails via ses and catch bounces and complaints to blacklist them on certain conditions. I'使用nodemailers Mailcomposer模块撰写原始电子邮件 .

here is my code to send the emails

var AWS          = require("aws-sdk");
var mailComposer = require('nodemailer/lib/mail-composer');

var ses = new AWS.SES({
...
}

let mailOptions = {
  from : "sender name <user@domain.com>",
  to : ["bounce@simulator.amazonses.com"],
  replyTo : 'demo@demo.com',
  inReplyTo : '12345-message-id', // The message-id this message is replying
  subject : "subject of this email",
  text : Buffer.from("plaint text version of the email", 'utf-8'), 
  html : Buffer.from("<div><p>Hello Customer</p></div>", 'utf-8'),

  // AND MY CUSTOM HEADER
  headers : {"customHeader" : "13371337"}, 

};
let mail = new mailComposer(mailOptions);
mail.compile().build((err, mailData) => {

  if(err){
    console.log("error occured compiling");
    console.log(err);
    return;
  }

  var params = {
    RawMessage : {
      Data : mailData
    },
  };

  ses.sendRawEmail(params, (err, data) => {
    if(err){
      console.log("error occured sending email");
      console.log(err);
    }else{
      console.log("success");
      console.log(data);
    }
  });
});

我在域名SES通知设置中也有 enabled "Include Original Headers" ,电子邮件发送成功,但我的通知后端服务在任何地方都没有收到customHeader ...