class GmailApp method .sendEmail()

GmailApp is the Apps Script service.

.sendEmail() is the method name you will see after a dot in your code.

What it does

Sends an email from the user's Gmail account.

Why it's used

  • Email a finished report or alert straight from a spreadsheet button.
  • Notify the team when a trigger spots a threshold breach.

Common errors

  • Forgetting parentheses on sendEmail. Write GmailApp.sendEmail(), not GmailApp.sendEmail or sendEmail by itself.
  • Skipping dots between chained calls. Each step needs a dot, like GmailApp.search('label:inbox').sendEmail().
  • Adding spaces where they do not belong. Write GmailApp.sendEmail(), not GmailApp .sendEmail(), GmailApp.sendEmail (), or GmailApp . sendEmail().
  • Wrong capitalization. Use GmailApp and sendEmail, not gmailapp or sendemail.

Explore

Related methods

Better Sheets tutorials

Automated Project Management in Google Sheets

Automated Project Management in Google Sheets

Create automatic notifications when a project is assigned, a project nee...
Automate Form Response to Confirmation Email

Automate Form Response to Confirmation Email

Create an email automatically when someone fills out a google form. incl...

Related blog posts

Written guides about GmailApp.sendEmail().

Browse the blog