- The issue is that you are using the exact same subject for these emails and therefore they end up in the same email thread.
For example:
This will put all the emails in the same thread:
function myFunction() {
for (let i=0; i<2; i++){
MailApp.sendEmail("[email protected]",
"Test", // subject is the same for every email
"This is an test email");
}
}
This will put the emails in different threads:
function myFunction() {
for (let i=0; i<2; i++){
MailApp.sendEmail("[email protected]",
"Test"+i, // subject is different for every email
"This is an test email");
}
}
Instead of using i
which is not very well descriptive as a subject, you could send the datetime:
"Test"+new Date()
although this might not work if the emails are sent instantly and therefore the subject will be the same again, but it might work in your case.
Ideally, you would want something that is relevant to the email, for example relevant to the body of your email.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…