Say you work for the PR department of a company and you have been asked to invite some journalists for a private briefing with company executives. Or you are having a birthday party at home and need to invite your friends over email.

In either of these scenarios, you would like to send personalized email messages to all the recipients and that’s where this Mail Merge program for Gmail can come in handy. Mail Merge is a built-in feature of Microsoft Outlook and Word but if you happen to live in the Gmail or Google Apps cloud, no worries as even Gmail users can use the magic of Google Scripts to perform mail merge in the browser.

Before we get started, watch this video demo to know what’s in store for you:

Mail Merge with Gmail – Step by Step

Open your Gmail mailbox and compose a new message. This will be just like any other email message except that you need to mark text that will vary in different messages. For instance, the first line of your messages could read Dear First-Name and you need a way to tell Gmail that First-Name is a variable field.

That’s easy. You just need to replace First-Name in the message with $%First-Name% as shown in the following screenshot. Similarly, replace all variable fields that are either in the body or the subject line of your Gmail message.

You can also include one or more attachments in your Gmail message. If you wish to include inline images in the mail, please upload them to a site like and then drag and drop them into your Gmail message (see PDF Tutorial).

Save the draft message in Gmail and then make a copy of this spreadsheet in your Google Drive.

Gmail Mail Merge

Open the Mail Merge spreadsheet that you’ve just copied and you’ll find some dummy data here to help you get started. You just need to change the column names in the spreadsheet such that they match the various variable fields that you marked in your Gmail draft message.

You can add (or remove) any number of columns but the one mandatory column that should exist in your spreadsheet is labeled Email Address. Just ensure that the column names in the spreadsheet and the variable fields in the Gmail messages are exactly same and that every Gmail variable to mapped to a column in Google Docs.

You need to have one row of data in the Google Spreadsheet for every recipient and the values of that particular row will be used to send a personalized message to that recipient. Please note Gmail has a daily sending limit and you can send a maximum of 100 messages in a day. If you would like to send more, switch to Mail Merge Premium.

Once you’ve filled the rows in the sheet with the necessary data, go to the Mail Merge menu in the Google Sheet and click Initialize. It may require authorization the first time you run this program so just click Grant Access. Don’t worry, you are just granting access to the sheet to access your Gmail account – no one else will have access to your data (Video).

start mail merge

Start Mail Merge in Google Docs

Now that you have granted access to Google Docs, click “Start Mail Merge”, choose the Gmail template you earlier created from the drop-down, enter the Sender’s name (this will show in the FROM field of your outgoing messages), tick the BCC option (if you want to get a copy of the outgoing emails) and hit Start Mail Merge. That’ it.

Once the mail merge is complete, a new column “EMAIL_SENT” will be added to every row indicating that the row need not be processed should you run Mail Merge again on the same set of data. If you plan to include that row in mail merge again, just change the Mail Merge status column for that row from EMAIL_SENT to blank.

Mail Merge with Gmail – Premium Edition

You can upgrade to the premium edition of Mail Merge (PDF Manual) that includes additional features like:

  • Send personalized attachments to different email recipients. The files can be stored in Google Drive
  • Track your outgoing email messages in Mail Merge with Google Analytics
  • Support for Gmail aliases so you can send mails from any email address linked to your Gmail account.
  • Specify a different ReplyTo address to receive replies on a different email address.
  • Since there’s a daily sending limit, the program will automatically split the mail sending job into smaller batches and execute them on consecutive days so that you never exceed the Google Scripts quota.
  • Premium support available via Email and Skype or Google Hangouts.

Gmail Mail Merge – Points to Remember

  • It’s always a good idea to test your Gmail templates before sending the email blast to dozens of people. For that, just have one or two data rows in your spreadsheet and put your own email addresses in the Email fields to ensure that your outgoing emails are working as expected.
  • If you find the concept of variables confusing, please see this simpler version of Gmail Mail Merge that uses HTML Mail, allows file attachments and also support Google Analytics tracking.

Awesome Google Scripts → Custom Google Scripts →