Join Scott Simpson for an in-depth discussion in this video Finding and sending messages with the Gmail service, part of Learning Google Apps Script.
- The GmailApp class allows a wide range of functions…to work with the Gmail Service,…including searching, reading, sending,…and starring messages, and threads of messages.…Let's take a brief look at a few functions…of the Gmail Service, starting with…listing messages in my inbox.…In the IDE, I'll create a new script and I'll call it Gmail.…Now I'll call the GmailApp service…and take a look to see what methods look like…they'd get me where I want to go.…
What these suggestions hint at…is that a fundamental component of working with messages…in Gmail is working with message threads.…Unless you know the specific ID of a message,…you'll need to get at it through a Gmail thread object.…I don't know the ID of a message or thread,…so I'll scroll down to look for a method I can work with.…Here's one called search, that looks promising.…The search method works just like…the search function in Gmail, it takes a string,…either a literal string that it searches…all of the messages in the inbox for,…or a more focused search using specifiers…
First, learn how to use simple scripts to edit documents and spreadsheets, work with files in Drive, and find and send messages in Gmail. Then find out how to add custom functionality to your spreadsheets, and build user interface elements for your scripts, using menus, alerts, and dialogs. Finally, Scott shows how to share your work with others by publishing scripts as web apps.
- What is Google Apps Script?
- Understanding script types
- Logging and debugging your scripts
- Scripting common tasks
- Building custom spreadsheet functions
- Creating add-on functionality such as dialogs and sidebars
- Sharing your script as a web app