Reputation: 1
I am trying to get certain company names to send to my email every day. I have set up the trigger and whatnot, but when I run the code, since I am trying to use a range of data, the email just says "Range," as opposed to the company names themselves.
I have tried various formatting, such as only saying A3:A9 as opposed to "A3:A9".
function EmailCheck() {
var sheet = SpreadsheetApp.getActiveSpreadsheet();
var range = sheet.getRange("A3:A9")
MailApp.sendEmail("[email protected]", "Emails for Today!", range)
}
I would like the email to say the words in range A3:A9, but right now it just says A3:A9
Upvotes: 0
Views: 41
Reputation: 2774
At the moment you're only getting a range object, not the values inside the range object.
You need to pass your range to .getValues()
to achieve your goal.
var range = sheet.getRange("A3:A9");
var values = range.getValues();
MailApp.sendEmail("[email protected]", "Emails for Today!", values);
Upvotes: 2