

Our first job it to get the emails we want to process. Now we are ready to start work on the application. Make sure that myFunction is selected in the drop down list and click the run icon or the debug icon:

All you get in this case as a starter is:īefore you can run your project you have to save it and this is also when you give it a name - gmailextract - say. You might think that as we want to work with GMail we should choose a GMail script, but in this case it is simpler to start with a Blank Project and build up only the code we actually need. In the main these choices simply add a few useful JavaScript functions relating to the service you are about to work with. This leads on to a dialog box which allows you to choose the type of script you want to create. The simplest way to create a new script is to go to the Google Drive page and click on Create, more then select Script: In this article it is assumed that you have a Google account, including email and Drive. If you are a complete beginner with Google Apps Script then see Getting Started With Google Apps Script for a general discussion. You can see that even if you you are not interested in the exact workings of this particular script, it still serves as a basis for similar operations. In the particular case of this example, the script processes bounced emails. The script reads a particular "folder" in Gmail, processes all of the emails it contains, stores some information extracted from the emails in a spreadsheet and then deletes the email. The obvious solution is to write a Google Apps Script that processes your email and this is exactly what this project is all about. Or you just want to deal with the bounced email from a mailshot.

If you use any email services then you will probably have encountered a problem that really needs automating.įor example, you need to collate the email addresses of people who have responded to an email you sent out to a bigger email list. Google Apps Script is basically a server-side implementation of JavaScript, complete with a set of classes that lets you access various Google services such as Gmail. If you have to administer an email list, creating a Google Apps Script to process email bounces and send the relevant data to a spreadsheet is not only useful but also a good example of using scripts.
