I am running the following script in Google apps script (emailAddress is a variable pulled from a sheet):
MailApp.sendEmail(emailAddress, subject, message,{htmlBody:message});
I am trying to add a cc and/or bcc string to this, but when I do so (and I using the correct format) I am getting a consistent error that there are too many strings when I do so.
Is MailApp.sendEmail limited to only four strings? Is my use of the {htmlBody:message} the problem? I was able to partially achieve what I am trying to do by eliminating this, but my goal is to send an html email out and copy that email to an internal address so all my staff can see the sent email, rather than only the sender.
Another issue is that I do not want the following
var emailSent = row[5];
if (emailSent != "EMAIL_SENT")
to operate on the cc'd and/or bcc'd email or my source sheet will include two EMAIL_SENT entries for every email.
Is there a solution?
Please try this:
MailApp.sendEmail(emailAddress, subject, message, {
htmlBody: message,
cc: '[email protected]',
bcc: '[email protected]'
});
There are other parameters also available check here : https://developers.google.com/apps-script/reference/mail/mail-app#sendemailrecipient-subject-body-options
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With