Mail Merge in Gmail With Attachment Support


The post and spreadsheet provided by Amit Agarwal on How to Create a Mail Merge with Gmail and Google Docs is extremely useful.  But for last few days, I have been wanting to send attachments along with the mail merge. I tried many options but was unsuccessful, finally a set of combinations worked for me and I am sharing that spreadsheet so others don’t have to go through the same trouble.

Follow the above provided link for understanding how to use Google Docs for mail merge, after that is working fine, you can use the following spreadsheet. This is the spreadsheet which can be used to add attachments to email. I have an editable column F13 where you will have to provide Document ID. Once you provide the document id, the steps to send emails are exactly same as mentioned by above blog post.

How to get Document ID:

Step 1: Upload the document that you want to attach on Google Docs.

Step 2: While uploading the document make sure that the option ‘Convert documents, presentations, spreadsheets, and drawings to the corresponding Google Docs formats’ is checked. If you do not check this option, your documents will not attach properly.

Step 3: Open the document and go to the URL. You can to use the id value as document id. Example: If URL is

https://docs.google.com/viewer?a=v&pid=explorer&chrome=true&srcid=0B_7_CbUovM_8YWJhYmQxNjktOTdiNS00ZWMyLTg3MzEtNGE3MWVhMjQyYTc4&hl=en

then the characters in bold are document id. Copy and paste them into the F13 box. When you send the mail, document with id will be attached.

I have added another feature of getting the remaining mail count of the day. That can also be accessed from the menu and count is shown above on the spreadsheet.

Update: I have updated the script to provide multiple attachments. Now columns F13 to F17 can contain different attachment IDs, or can be left blank.

Share and Enjoy:
  • Print
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • email
  • Netvibes
  • Twitter

, ,

  • http://topsy.com/veetrag.net/2011/01/25/mail-merge-in-gmail-with-attachment-support/?utm_source=pingback&utm_campaign=L2 Tweets that mention Mail Merge in Gmail With Attachment Support « Veetrag — Topsy.com

    [...] This post was mentioned on Twitter by Veetrag, iMorpheus. iMorpheus said: RT @kv: [blog] Mail Merge in Gmail With Attachment Support http://bit.ly/hLfR3l – added attachment support to @labnol's spreadsheet for … [...]

  • http://thejeshgn.com Thejesh GN

    But I cant use it with Google Apps account.

  • http://blog.chillpakistan.com/archives/3026 : : Chill Blog : : » How to Attach Files When Using Mail Merge in Gmail

    [...] with your message.Well there’s a new sheet to overcome that limitation. This is courtesy Kumar Veetrag who enhanced the original Google Docs script and added support for attachments.Attaching Files to [...]

  • http://rockinfrnz.com/archive/2011/01/26/how-to-attach-files-when-using-mail-merge-in-gmail/ How to Attach Files When Using Mail Merge in Gmail

    [...] there’s a new sheet to overcome that limitation. This is courtesy Kumar Veetrag who enhanced the original Google Docs script and added support for [...]

  • http://websonline.info/?p=1173 How to Attach Files When Using Mail Merge in Gmail – News from Tech

    [...] there’s a new sheet to overcome that limitation. This is courtesy Kumar Veetrag who enhanced the original Google Docs script and added support for [...]

  • http://veetrag.net veetrag

    You should be able to use it with apps account, because I developed/used this script over my apps account only.

  • http://www.technotree.org/how-to-attach-files-when-using-mail-merge-in-gmail/ How to Attach Files When Using Mail Merge in Gmail | Techno Tree

    [...] there’s a new sheet to overcome that limitation. This is courtesy Kumar Veetrag who enhanced the original Google Docs script and added support for [...]

  • http://hotpotblogs.com/how-to-attach-files-when-using-mail-merge-in-gmail/ How to Attach Files When Using Mail Merge in Gmail | HotPot Blogs – Blog anything and everythingHotPot Blogs – Blog anything and everything

    [...] there’s a new sheet to overcome that limitation. This is courtesy Kumar Veetrag who enhanced the original Google Docs script and added support for [...]

  • http://computer-technology.sescho.com/how-to-attach-files-when-using-mail-merge-in-gmail/ How to Attach Files When Using Mail Merge in Gmail | Sescho's technology blog

    [...] there’s a new sheet to overcome that limitation. This is courtesy Kumar Veetrag who enhanced the original Google Docs script and added support for [...]

  • http://gadgetfun.in/how-to-attach-files-when-using-mail-merge-in-gmail/ How to Attach Files When Using Mail Merge in Gmail | GadgetFun

    [...] there’s a new sheet to overcome that limitation. This is courtesy Kumar Veetrag who enhanced the original Google Docs script and added support for [...]

  • http://msrathore.com/blog/?p=1019 How to Attach Files When Using Mail Merge in Gmail « Mohinder's Blog

    [...] there’s a new sheet to overcome that limitation. This is courtesy Kumar Veetrag who enhanced the original Google Docs script and added support for [...]

  • http://demo.ifsa.in/?p=2602 How to Attach Files When Using Mail Merge in Gmail « ifsa.in

    [...] there’s a new sheet to overcome that limitation. This is courtesy Kumar Veetrag who enhanced the original Google Docs script and added support for [...]

  • JS

    This is great, but how do you send multiple attachments? I tried separating the Google Doc ID's with a comma, but this didn't work.

  • http://virtual-techs.net/how-to-attach-files-when-using-mail-merge-in-gmail/ How to Attach Files When Using Mail Merge in Gmail – Virtual Techs

    [...] there’s a new sheet to overcome that limitation. This is courtesy Kumar Veetrag who enhanced the original Google Docs script and added support for [...]

  • http://www.fabmart.in/?p=26 How to Attach Files When Using Mail Merge in Gmail | FabMart.in

    [...] there’s a new sheet to overcome that limitation. This is courtesy Kumar Veetrag who enhanced the original Google Docs script and added support for [...]

  • Tutoring

    I'm also looking for a sheet that allows for two separate attachments to go in the mail merge. Email me if you can help out: tutoring@viralgandhi.com

  • Zach

    um… the creator of the modified spreadsheet accidentally left about 375 of what I am assuming are his own personal contacts email addresses on a second sheet in the spreadsheet entitled “sent”. He/she may want to delete them from the sheet that is copying over.

  • http://www.it4smallbusiness.co.uk IT4SmallBusiness

    We have a Google script which allows multiple attachments, as well as multiple (user defined) fields within the email – it works very much as a Word mailmerge does.

    See

    http://www.it4smallbusiness.co

    The sheets and script are free to use/copy/modify.

  • http://www.it4smallbusiness.co.uk IT4SmallBusiness

    We have a Google script which allows multiple attachments, as well as multiple (user defined) fields within the email – it works very much as a Word mailmerge does.

    See

    http://www.it4smallbusiness.co

    The sheets and script are free to use/copy/modify.

  • Adminseeker

    it doesn’t work anymore. there’s a problem with line 116 in his script

  • http://www.it4smallbusiness.co.uk/ IT4SmallBusiness

    We’ve just updated our script at

    http://www.it4smallbusiness.co.uk/web-applications/google-mailmerge

    to allow mailmerge fields in the email subject

  • Russian

    We are from Russian and my english is very bad.After buy “Premium account” in Google.Apps for business, Gmail has a daily sending limit of 3.000 messages. But, script printing error “Exceeded maximum execution time” and stop sendig above 530 messages. How may debug this errors?

  • Robert McKay

    So I’d be very interested in a sheet with a COLUMN for attachment IDs, and recipients in rows, so you could send each recipient a different attachment. I’d love to use that to email my whole class their papers back, scanned with my written comments, you know? Also I wonder if this technique would work with PDFs uploaded to Drive, since they are not converted. Anyone know answers to either question?

  • http://www.sompal.org/2013/06/23/010211how-attach-files-mail-merge-gmail/ 01/02/11-How to Attach Files When Using Mail Merge in Gmail | Sompal.org

    [...] complete your mail merge. This is how your outgoing message will look like. My thanks to Veetrag who modified the original Google Docs code to add support for file [...]

  • ms curious
  • Adam

    Were you able to find a solution? I’m looking to something very similar.

  • mike

    whaat about images? or for signature images