Send Google Doc as PDF Email Attachment with Apps Script
Using Apps Script to send Google Docs as PDF email attachments is the most powerful option for recurring workflows. Write the script once and it runs automatically from that point forward.
The GmailApp and DriveApp combination
Apps Script provides two relevant services: DriveApp for accessing and exporting Drive files, and GmailApp for sending emails with attachments. Export the document as a blob using the export URL method, then pass the blob to GmailApp.sendEmail() as an attachment.
Sending to a dynamic recipient list
Read a list of email addresses from a Google Sheet or a hardcoded array in the script. Loop through the list and call sendEmail() for each recipient, customizing the email body for each one if needed.
Handling errors
Wrap the export and send steps in a try-catch block. Log errors to a Google Sheet or send an alert email to yourself if the script encounters a problem. This ensures you know if a scheduled delivery fails.
Frequently Asked Questions
Is Apps Script the best way to automate PDF email delivery from Google Docs?
For Google Workspace users, yes. It is free, built into Google, and has access to all the APIs needed for this workflow.
Can I use Apps Script to send PDFs from Google Sheets or Slides too?
Yes. The same approach works for Sheets and Slides. Just change the export MIME type to match the file type.
Related article
Google Docs to PDF with Gmail →Ready to Try It?
Install the free Chrome extension and start converting your Google Docs to PDF in one click.
Install Free Extension