Sunday 15 September 2013

google apps script - Why sendEmail function is not working? -


I'm trying to figure out what's wrong with my Google Apps Script. I am trying to send an email, when the cells in any column 2 do not have anymore, while the next cell is "no". Obviously, the email function is not working for any reason.

I make a little example of small spreadsheets below I want to send an email when the third line matches.

  1 2 3 1 00 - yes 2 00 - no 3 00 x not   

here is my code:

  Edit on function () {var s = SpreadsheetApp.getActiveSheet (); If (s.getName () == "sheet4") {// check that we are on the right sheet r = s.getActiveCell (); Var nextCell = r.offset (0, 1); If ((R.Gate column () == 2) & amp; (R.Gate value!) == '-') & amp; amp; (NextCale.Gate Value (=== 'No')) {// Check MailApp.sendEmail ('example@gmail.com ',' Test Email from Google Spreadsheet ',' Tell me that it has come right '); }}}}}    

onEdit () function is one Example of a simple trigger function as described, can not access services requiring simple trigger authentication. This is why Mailapp and GmailApp are not available for sending mail.

No comments:

Post a Comment