Home » Google AppScript13 February 2017

Google AppScript: Send Multiple Emails by reading data from Spreadsheet

This article shows how to read list of email addresses, subject and message body from Google Spreadsheet and send separate emails to all of them with Google AppScript.

First, let’s see a simple example of sending single message to a particular email address.

Send Single Email

Here, AppScript’s MailApp class is used to send email. We can also use GmailApp class to do so.

Read data from SpreadSheet and Send Multiple Emails

In the code below, a spreadsheet is opened by its id and then the data in it is read.

To get the spreadsheed id:

– Open Google Spreadsheet
– See the URL in your browser’s address bar
– The URL will be something like this: https://docs.google.com/spreadsheets/d/9tXNUNpM9tXNUNp0BydbYIIYLMxxxxxxxxxx/edit#gid=0
– So, in this case, the spreadsheet id is “9tXNUNpM9tXNUNp0BydbYIIYLMxxxxxxxxxx”

The data in the spreadsheet is in the following format:

nameemailsubjectmessage
John Rootjohn@example.comHello There!My first message
Liza Woodliza@example.comThank you friendMy second message
Tom Hankstom@example.comWelcome abroadMy third message
Sam Roysam@example.comHappy BirthdayMy fourth message

Hope this helps. Thanks.

Google AppScript

Get New Post by Email

Find me on

FacebookTwitterGoogle+LinkedInRSS Feed

Comments are closed.