Creating triggers manually
To create a trigger, in the code editor click on Resources and select Current project's triggers then the Current project's triggers dialog will open. Already created triggers will be listed in this dialog, otherwise a link to create a new trigger will appear. Click on the No triggers set up. Click here to add one now link. Select the options from the dropdowns as shown in the following screenshot:
Under the Run heading, select the sendEmail
function for which you want to create the trigger. Select From spreadsheet and On form submit under the Events heading as shown in the preceding screenshot.
If a Form user submits data to the spreadsheet, the trigger will run the sendEmail
function.
For more info on triggers, please go to https://developers.google.com/apps-script/guides/triggers/.