如何发送正文中包含不同消息的电子邮件。我知道如何将相同的消息发送给不同的人,但不知道如何将具有特定模式的不同消息正文发送给不同的接收者。
`var mailOptions = {
from: "xyz <xyz@gmail.com>", // sender address
to: "abc@abc.com, lmn@lmn.com, akb@gmail.com", // list of receivers
subject: "Hello ", // Subject line
text: "Hello world ", // plaintext body
html: "<b>Hello world </b>" // html body
};`
// send mail with defined transport object
smtpTransport.sendMail(mailOptions, function(error, response){
if(error){
console.log(error);
}else{
console.log("Message sent: " + response.message);
}
// if you don't want to use this transport object anymore, uncomment following line
//smtpTransport.close(); // shut down the connection pool, no more messages
});
对于不同的接收者相同的消息