I am trying to send email via script in Google Spreadsheet. I know that the argument in this case cell B4 will be integer.
In my cell is function =sendEmails(B4)
and my script looks like this.
function sendEmails(result) {
var cell = Number(result);
Logger.log(cell);
Logger.log(result);
MailApp.sendEmail("[email protected]", "Lab", cell);
MailApp.sendEmail("[email protected]", "Lab", result);
}
But the problem is that in the logs it shows this and the same arrives by email.
[15-09-27 20:13:01:449 CEST] NaN
[15-09-27 20:13:01:449 CEST] undefined
Where is my mistake?