Skip to content Skip to sidebar Skip to footer

Google-apps-script Will Not Send Email Inside An Onedit Function

I have a script that sends an email when the spreadsheet is edited. The script runs, but the MailApp statement does not work. Here is the execution log: [15-01-27 14:15:17:951 EST

Solution 1:

Like the other answer says you cant call sendMail from the normal onEdit.To fix: rename onEdit to something else like "onEditTrigger" and manually install the trigger from the "Resources" menu.That link also explains the difference, including the restriction you just found out, between the different types of triggers. In this case, onEdit is a simple trigger while my onEditTrigger is an installable trigger

Solution 2:

You are getting this error because you are calling sendMail inside the onEdit() trigger. You cannot call URLFetch or MailApp methods inside onEdit.

Post a Comment for "Google-apps-script Will Not Send Email Inside An Onedit Function"