What good is an email you can only send to one person? How else would you catch people accidentally hitting “Reply All”? The
N/email.send() method supports multiple recipients as well as
results in an email with a list of recipients:
recipients property supports a single internal ID or a single email address
string to send to one person, or an Array of those to send to multiple people. Here we have an Array containing two email addresses, thus our
to line on the email will have these two recipient addresses.
send() method also provides the
bcc options to provide the corresponding functionality. These two properties behave identically to the
recipients property in that they accept a single ID or address as well as an Array containing either or both.
cc: [17, “email@example.com”] will CC both
firstname.lastname@example.org as well as the Entity record with internal ID
Similarly, bcc: [“email@example.com”, 21, “firstname.lastname@example.org”] will BCC three different email addresses:
email@example.com, and the Entity record with internal ID
Note that the
send() method is limited to a maximum of
10 recipients across all of
If you need to send emails to larger audiences, such as with Marketing Campaigns, there are other methods within
N/email for that purpose. Researching them on your own is a useful exercise.
This is a complete chapter from the Sending Email with SuiteScript Cookbook.