Email a PDF Automatically After Apps Script Conversion
Combining PDF conversion with email delivery in one script removes another manual step from your workflow. Convert the document, attach the PDF to an email, and send it, all in one function run.
Using MailApp to send the PDF
After creating the PDF blob, pass it directly to MailApp.sendEmail() as an attachment. The method accepts a recipient, subject, body, and an attachments array. Include the PDF blob in the array without saving it to Drive first, or save it to Drive and then attach it by fetching the file blob.
Dynamic recipient lists
Hard-coding the recipient address works fine for personal automation. For team workflows, store the recipient list in a Google Sheet or PropertiesService and read it at runtime. This lets you update recipients without editing the script.
Email content and subject
A useful email subject includes the document name and the date: 'PDF Ready: ' + docName + ' - ' + formattedDate. The body can list which files were converted, note any failures, and include a link to the Drive folder for easy access.
Frequently Asked Questions
Is there a limit on how many emails Apps Script can send?
Gmail accounts can send up to 100 emails per day through MailApp. Google Workspace accounts have a higher limit. For high-volume email distribution, consider using a dedicated email service.
Can I send the PDF to multiple people at once?
Yes. Pass a comma-separated string of email addresses as the recipient. Each person receives the same email with the PDF attached.
Related article
Send converted PDFs to Slack with Docs to PDF →Ready to Try It?
Install the free Chrome extension and start converting your Google Docs to PDF in one click.
Install Free Extension