class GmailApp method .getAliases()

GmailApp is the Apps Script service.

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

What it does

Returns the email addresses the user can send from.

Why it's used

  • Pick the right From address when the user has several aliases.
  • Send from support or billing depending on the row in your sheet.

Common errors

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

Explore

Related methods

Better Sheets tutorials

No tagged tutorials yet. Fetch Apps Script from the harvest table and this page fills automatically.

Related blog posts

Written guides about GmailApp.getAliases().

Browse the blog