I have a script in Google Apps Script that sends me an email using the MailApp.sendEmail() function. I ran it once in the editor and it asked me to authorize the script so I did. I then scheduled it to run with a project trigger, but when it does I get an error email from Google Apps Script that says: "Authorization is required to perform that action.".
Why is it getting an authorization error when running as scheduled vs running from the editor and how do I make sure it is authorized?
NOTE: I have the @OnlyCurrentDoc tag at the top of the script.