0
본문에 다른 메시지가있는 전자 메일을 보내는 방법. 다른 사람들에게 동일한 메시지를 보내는 방법을 알고 있지만 다른 패턴을 가진 다른 메시지 본문을 다른 수신자에게 보내는 방법을 모르겠습니다. 다른 수신기 같은 메시지다른 메시지 nodejs를 사용하여 다른 수신자에게 전자 메일 보내기
본문에 다른 메시지가있는 전자 메일을 보내는 방법. 다른 사람들에게 동일한 메시지를 보내는 방법을 알고 있지만 다른 패턴을 가진 다른 메시지 본문을 다른 수신자에게 보내는 방법을 모르겠습니다. 다른 수신기 같은 메시지다른 메시지 nodejs를 사용하여 다른 수신자에게 전자 메일 보내기
사용 https://github.com/caolan/async에 대한
`var mailOptions = {
from: "xyz <[email protected]>", // sender address
to: "[email protected], [email protected], [email protected]", // 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
});
:
var async = require("async");
// setup e-mail data with unicode symbols
var mailOptions = {
from: "xyz <[email protected]>", // sender address
subject: "Hello ✔", // Subject line
text: "Hello world ✔", // plaintext body
html: "<b>Hello world ✔</b>" // html body
}
var toEmail = ["[email protected]", "[email protected]", "[email protected]"];
// send mail with defined transport object
async.forEachLimit(toEmail,1,function(email,callback){
mailOptions["to"] = email;
//manipulate the text
mailOptions["text"] = "Hi" + email;
smtpTransport.sendMail(mailOptions, function(error, response){
if(error){
console.log(error);
}else{
console.log("Message sent: " + response.message);
}
callback();
});
});
이 당신에게
덕분에 많은 도움이되는지 잘 모릅니다. 도움이 됐어. –