I am unable to send email through google script to multiply addresses
Tried with GmailApp.sendEmail,MailApp.SendEmail, var recipient = testmail + chemAmail ;.
var testmail = "example1@gmail.com" ;
var chemAmail = "example2@gmail.com" ;
var body = "Hi,<br><br>" +
"This is a Quality Alert.Please brief the required people and submit the Briefing Record EForm when it is completed." + "<br><br>" +
"The details are stated below :<br>" +
"Customer: " + customer + "<br>" +
"Part Number: " + part + "<br>" +
"S Number: " + s + "<br>" +
"ID Number: " + id + "<br>" +
"Defect : " + defect + "<br>" +
"Description : " + desc + "<br>" +
"Reject Photos : " + reject + "<br>" +
"Okay Photos : " + ok + "<br><br>" +
"Please complete it as soon as possible." + "<br><br>" +
"Thanks." ;
// Sends if chemA is ticked (Conditions for email to be sent)
if(chemA == '✔')
{
var recipient = testmail , chemAmail;
var subject = "Quality Alert for Chem A";
}
GmailApp.sendEmail(recipient, subject, " ",{htmlBody: body});
I can send it to testmail only. I want to be able to send to multiple email addresses.
If my understanding is correct, how about this modification?
var recipient = testmail , chemAmail;
var recipient = [testmail, chemAmail];
comma separated list of email addresses
at GmailApp.sendEmail().
array.join(",")
.recipient
: comma separated list of email addresses